From: Fam Zheng <famz@redhat.com>
To: ronnie sahlberg <ronniesahlberg@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Peter Lieven <pl@kamp.de>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCHv4] block: add native support for NFS
Date: Thu, 26 Dec 2013 16:15:24 +0800 [thread overview]
Message-ID: <52BBE59C.2020101@redhat.com> (raw)
In-Reply-To: <CAN05THRgNweD1Dm5GLppCx+V4RA=PEyxQQ+rbtZZSJVRifPkSg@mail.gmail.com>
On 2013年12月26日 14:10, ronnie sahlberg wrote:
> On Wed, Dec 25, 2013 at 9:42 PM, Fam Zheng <famz@redhat.com> wrote:
>> On 2013年12月21日 00:04, Peter Lieven wrote:
>>>
>>> This patch adds native support for accessing images on NFS shares without
>>> the requirement to actually mount the entire NFS share on the host.
>>>
>>> NFS Images can simply be specified by an url of the form:
>>> nfs://<host>/<export>/<filename>
>>>
>>> For example:
>>> qemu-img create -f qcow2 nfs://10.0.0.1/qemu-images/test.qcow2
>>>
>>> You need LibNFS from Ronnie Sahlberg available at:
>>> git://github.com/sahlberg/libnfs.git
>>> for this to work.
>>>
>>> During configure it is automatically probed for libnfs and support
>>> is enabled on-the-fly. You can forbid or enforce libnfs support
>>> with --disable-libnfs or --enable-libnfs respectively.
>>>
>>> Due to NFS restrictions you might need to execute your binaries
>>> as root, allow them to open priviledged ports (<1024) or specify
>>> insecure option on the NFS server.
>>>
>>
>> What are the error messages like, if no privilege. Is root always required
>> for this to work?
>
> NFS servers often default to only allow client connections that
> originates from a system port.
> I know three different ways to solve this:
>
> 1, Run QEMU as root, which allows libnfs to bind to a system port.
> This is probably suboptimal since I guess most people would want to
> avoid running qemu as root if they can avoid it.
>
> 2, Change the NFS server to allow connections from nonsystem ports. On
> linux NFS servers this is done by adding
> "insecure" as the export option in /etc/exports.
> This may be preferable to option 1 (since secure/insecure does not
> really add much security in the first place).
>
> 3, Assign the capability to qemu to bind to system ports when running
> as non-root user.
> This is probably the most attractive option of the three.
> You can still run qemu as non-root and you dont have to change the
> security mode on the NFS server.
> It is highly non-portable though and only work on platforms that
> provide capabilities.
> On linux you add this capability using :
> sudo setcap 'cap_net_bind_service=+ep' /path/to/executable
>
>
Thank you very much for elaboration, Ronnie. It's clear to me now and
hopefully this can help users with their setup too.
Fam
prev parent reply other threads:[~2013-12-26 8:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-20 16:04 [Qemu-devel] [PATCHv4] block: add native support for NFS Peter Lieven
2013-12-26 5:42 ` Fam Zheng
2013-12-26 6:10 ` ronnie sahlberg
2013-12-26 8:15 ` Fam Zheng [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52BBE59C.2020101@redhat.com \
--to=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=pl@kamp.de \
--cc=qemu-devel@nongnu.org \
--cc=ronniesahlberg@gmail.com \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.