LXC and wine (NOT LXD)


(Will FT) #1

Hi,

I create an LXC container
lxc-create -t ubuntu -n fir

Inside the container I install wine successfully
sudo apt install wine

Trying to open a windows GUI application I get:

ubuntu@fir:~$ export DISPLAY=:0
ubuntu@fir:~$ wine notepad
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.
err:systray:initialize_systray Could not create tray window
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.

From here:

I saw that in LXD we can give:

$ lxc config device add wine-games X0 disk path=/tmp/.X11-unix/X0 source=/tmp/.X11-unix/X0 
$ lxc config device add wine-games Xauthority disk path=/home/ubuntu/.Xauthority source=/home/MYUSERNAME/.Xauthority

Is something similar possible for LXC?

Thanks


(Stéphane Graber) #2

You’d need to use lxc.mount.entry lines for each of those, which is effectively what LXD does behind the scenes.