[Users] OpenVZ guest device passthrough
John Knight
jknight at aretta.com
Mon Nov 22 01:37:28 EST 2010
Hi Charles,
One more thing I forgot to mention:
>> From the hardware node, you would run:
>>
>> "# vzctl set 1000 --devnodes device:rw --save"
>>
>> (where '1000' is your container id and 'device' is the device you
>> want to passthrough in /dev/. In the above example you would be
>> sharing the host node's /dev/device device. )
>
> Ah I see. It wasn't immediately clear to me from the man page if the
> path specification was /dev/device or just device. That clears things
> up a fair amount. Now I have to figure out what device in /dev I
> would use for a USB wireless card. :)
Make sure you go through your /etc/vz/conf/(whatever your container id
is).conf file and remove and previous entries if they were erroneous.
John Knight,
Aretta Communications
On 11/22/2010 01:29 AM, Charles N Wyble wrote:
> On 11/21/2010 10:17 PM, John Knight wrote:
>> Hi Charles,
>>
>> OpenVZ does support passthrough to varying success rates depending on
>> what you're doing (but I have yet to really find anything it doesn't
>> work well with).
>
> Thanks.
>
>>
>> From the hardware node, you would run:
>>
>> "# vzctl set 1000 --devnodes device:rw --save"
>>
>> (where '1000' is your container id and 'device' is the device you
>> want to passthrough in /dev/. In the above example you would be
>> sharing the host node's /dev/device device. )
>
> Ah I see. It wasn't immediately clear to me from the man page if the
> path specification was /dev/device or just device. That clears things
> up a fair amount. Now I have to figure out what device in /dev I
> would use for a USB wireless card. :)
>
>>
>> Next, make sure that if a certain user beyond root needs access to
>> this device that you set it up on the node and in the container:
>>
>> vzctl exec 1000 chown -R user:group /dev/device
>> vzctl exec 1000 chown -R user:group /lib/udev/devices/device
>> adduser user
>> chown -R user:group /dev/device
>
> Ah right.
>
>>
>>
>> So, summing it all up and giving an example, let's say you want to
>> share the fictitional hardware device /dev/fake1 with container 1000
>> and in the container you need to make it accessible by the user and
>> group "fake user". The following are the commands you would use to
>> do so:
>>
>> ------
>> # create the passthrough
>> vzctl set 1000 --devnode fake1:rw --save
>>
>> # assign permissions
>> vzctl exec 1000 chown -R fake1:fake1 /dev/fake1
>> vzctl exec 1000 chown -R fake1:fake1 /lib/udev/devices/fake1
>>
>> # add user on node so permissions stick through pam
>> adduser fake1
>> chown -R fake1:fake1 /dev/fake1
>> ------
>>
>> After performing the above from the hardware node the container is
>> hosted on, you should now have a /dev/fake1 inside container 1000
>> with the correct permissions.
>>
>>
>
> Fantastic. Thanks. I'll give it a shot and let the list know.
>
>
> _______________________________________________
> Users mailing list
> Users at openvz.org
> https://openvz.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openvz.org/pipermail/users/attachments/20101122/36c40c34/attachment-0001.html
More information about the Users
mailing list