[Lxc-users] How to allow access to a /dev/tty

Guillaume Thouvenin guillaume.thouvenin at polymtl.ca
Thu Mar 28 10:54:30 UTC 2013


Hello,

  I'm trying to run an X server inside a container. I was able to 
achieve this with lxc-tools by setting the option lxc.tty = 4 that 
allows access to 4 tty. Now I want to use libvirt because my final goal 
is to create a container with GPU capabilities from Openstack (that 
uses libvirt).

  My first idea was to create a /dev/tty2 (because /dev/tty1 already 
exist) and allow access by echoing 'c 4:2 rwm' in devices.allow. But I 
don't have the right if I am in the container. So I tried to create the 
tty2 in the device tree of the container but from the host. It works 
but I don't see the tty2 device in the container. In facts, things that 
are seeing in the /dev in container are not the same that things that 
are seen from outside.

 From the container:
root at b017311-ux:~# ls /dev/
console  fd  full  log  null  ptmx  pts  random  shm  stderr  stdin  
stdout tty1  urandom  xconsole  zero

 From the 'real' world:
root at b017311-ux:/home/thouveng/virtualization/lxc/lxcvm1/rootfs/dev# ls
console  fd    kmem   loop1  loop3  loop5  loop7  null  ptmx  ram   
ram1   ram11  ram13  ram15  ram2  ram4  ram6  ram8  random  stderr  
stdout  tty0  urandom   zero
core     full  loop0  loop2  loop4  loop6  mem    port  pts   ram0  
ram10  ram12  ram14  ram16  ram3  ram5  ram7  ram9  shm     stdin   tty 
     tty2  xconsole


  So any help to allow the access to tty from the container to run an X 
server would be welcome. I want to run an X server because I want to do 
remote rendering with the GPU, not only computation. The only solution 
I found on the web works with lxc-tools.


Best regards,
Guillaume





More information about the lxc-users mailing list