I'm desperately trying to trying to enable remote desktop on Ubuntu 21.10, in a way that could allow me to view and control the desktop even when there is no monitor attached to the computer. I've tried all the following solutions and softwares:
- RealVNC server: doesn't work with Wayland and requires an account
- TigerVNC: I wasn't able to view the desktop, perhaps incompatible with Wayland?
- TightVNC: doesn't even start
- Xrdp with X11 enabled: crashes because of some strange permission problem
- Vino: deprecated, no Wayland support
- GNOME's built-in remote desktop server: works, but requires being enabled on a per-network basis, which makes it impractical when connecting the computer to a new network (I would need a physical monitor to enable that network). Moreover, it doesn't work when no monitor is connected
I've also tried the following workarounds:
- Use GNOME 40's new feature: virtual desktops. Running
mutter --wayland --headless --virtual-monitor 1920x1080prompted me to install
mutter, and after doing that, it complained that
mutterwas already running and the command crashed. This happened because GNOME's compositor already runs inside GNOME itself (in the process
Xwayland), so running
mutterdirectly seems to be forbidden.
- Enabling X11 and using
xserver-xorg-video-dummy(see Add Fake Display when No Monitor is Plugged In). The computer didn't even boot with that Xorg configuration and it was a pain to fix.
- Enabling X11 and creating a custom Xorg config file as describled here: Add VIRTUAL output to Xorg. GNOME's remote desktop still closed when I unplugged the monitor.
I did't remember that VNC/RDP on Ubuntu was such a frustrating experience. I am honestly disappointed. Hopefully someone knows how I can do it.
Update 1: RealVNC doesn't even work with X11 for some unknown reason. It says it can't connect to the 5900 port, which is, however, open (I even disabled
Update 2: I tried the ancient and ugly
x11vnc server (with X11 enabled), using the workaround found on this website, plus some more thinkering to get it working with the latest Ubuntu version. I had to change some permissions and create the following
[Unit] Description=Start x11vnc. After=multi-user.target [Service] Type=simple User=<MY_USERNAME> Group=<MY_USERNAME> ExecStart=/usr/bin/x11vnc -display :0 -loop -forever -bg -rfbport 5900 -xkb -noxrecord -noxfixes -noxdamage -shared -norc -auth /run/user/1000/gdm/Xauthority -rfbauth /etc/x11vnc.pass [Install] WantedBy=multi-user.target
aaaand it doesn't work... The VNC server stars on boot if, and only if, there's a monitor plugged in. After that, I can unplug the monitor and it keeps working. This is not what I was looking for, however, and thus I am going to give up. I've already wasted too many hours getting this to work.