How to access Ubuntu GUI through Teamviewer on headless server?

11,784

Solution 1

The package "xserver-xorg-video-dummy" appears to do what is required

Some details on setting it up in this question

Add Fake Display when No Monitor is Plugged In

Solution 2

I have basically installed a package xserver-xorg-video-dummy with sudo apt install xserver-xorg-video-dummy then created a config file named xorg.conf with following content:

Section "Device"
    Identifier  "Configured Video Device"
    Driver      "dummy"
EndSection

Section "Monitor"
    Identifier  "Configured Monitor"
    HorizSync 31.5-48.5
    VertRefresh 50-70
EndSection

Section "Screen"
    Identifier  "Default Screen"
    Monitor     "Configured Monitor"
    Device      "Configured Video Device"
    DefaultDepth 24
    SubSection "Display"
    Depth 24
    Modes "1366x768"
    EndSubSection
EndSection

I also created two scripts monitor.sh and nomonitor.sh:

monitor.sh:

sudo rm /usr/share/X11/xorg.conf.d/xorg.conf

nomonitor.sh:

sudo cp xorg.conf /usr/share/X11/xorg.conf.d/

You can execute one of the scripts over the ssh or when the monitor is attached.

You will need to execute sudo reboot after executing the scripts.

You can execute then xvnc or teamviewer as you like.

Share:
11,784

Related videos on Youtube

hppyfngy
Author by

hppyfngy

Updated on September 18, 2022

Comments

  • hppyfngy
    hppyfngy over 1 year

    I'm building what will primarily be a Plex Media Server, but I also like to tinker with Linux, so I'd like to get to the GUI via Teamviewer.

    I got everything up and working before I realized GUI doesn't load without a monitor attached.

    How can I set up a dummy monitor, or something? I'm not very good with command line, but can do it well enough to follow instructions. This box will be running without keyboard, monitor, or mouse.

    • Admin
      Admin over 9 years
      Use a VNC serer such as FreeNX or vncserver
    • Admin
      Admin over 8 years
      To improve bohdi's very low quality comment, alternatives to consider Install an NX server like X2Go or How do I install a VNC server?.
    • Admin
      Admin over 5 years
      You can use also a screen program to display virtual desktop.
  • hppyfngy
    hppyfngy over 9 years
    Nothing I've tried causes X to load the desktop unless there is a monitor plugged in, and I've seen this as an issue everywhere I've searched. Are you sure about this? With a monitor attached, I can get to the GUI with Teamviewer. Without the monitor, nothing shows up on my remote admin computer. It just won't connect. I can still use Plex, so the computer is running properly and is available on my network.
  • matt
    matt over 9 years
    Sorry, I found another post that could be worth checking, i've edited
  • Daniel Dolz
    Daniel Dolz almost 4 years
    aparently xserver-xorg-video-dummy won't install after 18.04 update