Host: Ubuntu Server 20.04
LXC 4.20
I am trying to configure as setup where GUI desktops and apps are run in containers, with the GUI displayed on a specified video output.
I have followed this tutorial, and it works for me when I already on a GUI desktop. However I’d rather not run a window manager on my host and just use Xorg to target the desired displays.
I am also able to get xeyes running on the host video output using commands over ssh.
If I install a desktop on the host and then create a container with nvidia.runtime=false
, I can then ssh into the host, run the container, and then run glxgears
, which pops up in a desktop window on the host.
It seems that the sticking point is the use of nvidia.runtime=true
. That seems to be needed for the GUI, and I am unable to start containers that use that option.
- Am I correct that if I can create the container with
nvidia.runtime=true
, I should be able to target glxgears (or any other X11 app, or an entire desktop) to a display without recourse to a window manager on the host?
This is what I get when I try to create containers with nvidia.runtime=true
:
~$ lxc launch ubuntu:18.04 --profile default --profile x11 mycontainer
Creating mycontainer
Starting mycontainer
Error: Failed to run: /snap/lxd/current/bin/lxd forkstart mycontainer /var/snap/lxd/common/lxd/containers /var/snap/lxd/common/lxd/logs/mycontainer/lxc.conf:
Try `lxc info --show-log local:mycontainer` for more info
~$ lxc info --show-log local:mycontainer
$ lxc info --show-log local:mycontainer [7/52]
Name: mycontainer
Status: STOPPED
Type: container
Architecture: x86_64
Created: 2021/11/13 19:43 EST
Last Used: 2021/11/13 19:43 EST
Log:
lxc mycontainer 20211114004327.995 WARN conf - conf.c:lxc_map_ids:3579 - newuidmap binary is missing
lxc mycontainer 20211114004327.996 WARN conf - conf.c:lxc_map_ids:3585 - newgidmap binary is missing
lxc mycontainer 20211114004327.997 WARN conf - conf.c:lxc_map_ids:3579 - newuidmap binary is missing
lxc mycontainer 20211114004327.997 WARN conf - conf.c:lxc_map_ids:3585 - newgidmap binary is missing
lxc mycontainer 20211114004327.997 WARN cgfsng - cgroups/cgfsng.c:fchowmodat:1251 - No such file or directory - Failed to fchownat(40, memory.oom.group, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc mycontainer 20211114004328.178 ERROR conf - conf.c:run_buffer:321 - Script exited with status 1
lxc mycontainer 20211114004328.178 ERROR conf - conf.c:lxc_setup:4386 - Failed to run mount hooks
lxc mycontainer 20211114004328.178 ERROR start - start.c:do_start:1275 - Failed to setup container "mycontainer"
lxc mycontainer 20211114004328.178 ERROR sync - sync.c:sync_wait:34 - An error occurred in another process (expected sequence number 4)
lxc mycontainer 20211114004328.183 WARN network - network.c:lxc_delete_network_priv:3617 - Failed to rename interface with index 0 from "eth0" to its initial name "veth3a4c754a"
lxc mycontainer 20211114004328.183 ERROR lxccontainer - lxccontainer.c:wait_on_daemonized_start:867 - Received container state "ABORTING" instead of "RUNNING"
lxc mycontainer 20211114004328.184 ERROR start - start.c:__lxc_start:2074 - Failed to spawn container "mycontainer"
lxc mycontainer 20211114004328.184 WARN start - start.c:lxc_abort:1039 - No such process - Failed to send SIGKILL via pidfd 41 for process 88802
lxc mycontainer 20211114004333.266 WARN conf - conf.c:lxc_map_ids:3579 - newuidmap binary is missing
lxc mycontainer 20211114004333.266 WARN conf - conf.c:lxc_map_ids:3585 - newgidmap binary is missing
lxc 20211114004333.300 ERROR af_unix - af_unix.c:lxc_abstract_unix_recv_fds_iov:218 - Connection reset by peer - Failed to receive response