The following is from my github page the README file attached bellow summarize my setup. The config file is in the github above.
lxd Archlinux container with X11 server sharing GPU with host
Running arch Xserver container alongside Ubuntu Desktop sharing the Nvidia gpu
attchated config file (there is some redundances that I need to fix)
The host is ubuntu 20.04. I installed the full set of nvidia drives which come with the cuda. (I do not need to install the nvidia-cuda-toolkit)
After staring the privileged arch container:
- Install X11 and the nvidia Driver (It has to be the exact version as it is in the host)
- recompile gdm with the following flag added “–with-initial-vt=8”
- create a systemd unit (I called it rc.local) that will run before gdm. It will do the follwing. see (rc.local attachment)
- Establish network connection (there some incompitability between systemd and arch containers) So networking needs to be setup manually
- Create /etc/resolv.conf for DNS resolution
- create /usr/share/X11/xorg.conf.d/10-lxc-input.conf This adds the evdev devices to X11
I did not include my setup for pulseaudio since it does not work well (in the config file I share /dev/snd with the host)
Work that needs to get done
- Switch to wayland
- fix pulseaudio.
- Guest share the host gdm instead of using the container gdm