I’m running an Ubuntu 22.04 container in Incus. So far, I have enabled an x11 server and am running an Xfce desktop. I have accessed it through VNC. The mouse pointer moves, but I cannot click and keyboard input does not work.
Can anyone help me to pass the right devices/give the right permissions?
I’m honestly loading as many devices as I can just to see which one will work until I can narrow down what exactly is necessary.
The end goal is to be able to run several containers that can play games (emulators, Steam) and use Sunshine/Moonlight to stream to clients. I prefer containers over VMs because it allows the use of a single GPU for several clients. Right now, I am testing without GPU because my GPU server is down for a few days.
There are already several tutorials on how to GUI apps in system containers. I would suggest to consult them. Doing this through VNC for games may be painful. But if you insist, then you would just need X11 forwarding when you SSH to the system container. It’s a parameter in SSH to forward for you the Unix socket for the X server. Then, you run an X11 app in the container and you get the output on your desktop.
An improvement is to setup X2Go. With this you you will get a whole desktop session in the container, and on your desktop you would get a window of that desktop session. Really cool, download:start [X2Go - everywhere@home]
I don’t think it’s a dependency problem, normally everything needed was installed when installing Xfce. But you can try install xserver-xorg-input-mouse for ps2 mouse which is the default virtual mouse.
If it’s a x11 problem, you can find it in x11’s log.
There is one more possible problem. It’s happens when you have a custom x11 config which you messed up. You can find it in x11’s log too.
This is an example of using X11 forwarding. Gets the job done, no acceleration. The next step up is to setup a VNC server in the container and connect with a VNC client. Then, all other methods up to using the GPU in the container and getting proper gameplay.
$ incus launch images:ubuntu/24.04/cloud x11
Launching x11
$ incus exec x11 -- passwd ubuntu
New password:
Retype new password:
passwd: password updated successfully
$ incus exec x11 -- apt install openssh-server x11-apps
...
$ incus list x11 -c ns4
+------+---------+---------------------+
| NAME | STATE | IPV4 |
+------+---------+---------------------+
| x11 | RUNNING | 10.10.10.126 (eth0) |
+------+---------+---------------------+
$ ssh -X -o PreferredAuthentications=password -o PubkeyAuthentication=no ubuntu@10.10.10.126
ubuntu@10.10.10.126's password:
Welcome to Ubuntu 24.04.2 LTS (GNU/Linux 6.8.0-60-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
Last login: Thu Jun 26 12:41:07 2025 from 10.10.10.1
/usr/bin/xauth: file /home/ubuntu/.Xauthority does not exist
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
ubuntu@x11:~$ xclock