I have two vertical monitors that I want to use to connect to a remote computer without any monitors. Both the remote computer and my local computer are located on the same desk, in hands' reach. Both have Ubuntu desktop installed.

I've run across so many small problems that I'm worried that I'll run into the XY problem if I just go into the details too much.

First of all, there's the issue of connecting with VNC before logging into the session onto the remote computer. Apparently in 18.04, I'd have to switch back to lightdm, and I'd rather not to. Activating autologin on the user was suggested by some, not sure if that's an appropriate solution.

Currently I'm switching one of my monitors and keyboard physically back to the remote computer just for login, and switch it back afterwards.

Secondly, I don't have two monitors active on the remote computer. It's suggested to create fake monitors and adjust them accordingly, but when I try to do that on the remote computer, I get

$ xrandr --newmode  "1200x1920_60.00"  196.47  1200 1296 1424 1648  1920 1921 1924 1987  -HSync +Vsync
Can't open display 

Perhaps one needs at least one active display to run that?

Finally, depending on whether I have to connect back one monitor everytime I restart the computer or not, there'll be one monitor already present in the configuration.

What is the easiest way to setup the connection to the remote computer via VNC in a way that I can use both my monitors?


Perhaps one needs at least one active display to run that?

This is likely because the system is running in a headless mode and has no X Display server running. You can install xvfb which is the "X Server Virtual Frame Buffer"

sudo apt install xvfb

Then you can create a virtual frame buffer:

Xvfb :1 -screen 0 800x600x16

You should be able to start a VNC server on that machine using various servers, including:

x11vnc -display :1
  • 1
    So, to get this running I needed to export DISPLAY=:1 before Xvfb. However, after connecting via vnc I just get a black screen. Can't I access my usual login window/desktop? – FooBar Sep 24 '18 at 15:57

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.