[SOLVED] Headless TeamViewer on Ubuntu 19.10

Aravind V Nair

Honorable
May 27, 2013
23
0
10,520
1
Hey folks!

I have been attempting to connect to my home server running Ubuntu 19.10 over TeamViewer from my other devices (Linux computers, Android phones or Windows computers) in vain. I have tried fiddling with Xorg configurations, installing and uninstalling various things.

To summarise:

  • Unable to connect to the server without a monitor connected. It does connect, but I end up on a black screen.
  • When I installed 'xserver-xorg-video-dummy' package and tried setting Xorg configurations in 'etc' and 'usr' in their respective paths, I could no longer log in to Ubuntu by entering by username and password via TeamViewer on the Ubuntu login screen until I got rid of it via ssh. Also, when I installed the package, my mouse and keyboard stopped working. Only through TeamViewer, it was accessible. Installing the package also disabled my monitor.
  • The same issue persists when I am using with the monitor and I disconnect the monitor while TeamViewer is running.
What I am looking to do:
  • Have a headless Ubuntu 19.10 server accessible over TeamViewer.
  • Should be able to use when monitor is also connected.
  • All hardware should be accessible.
Any help or suggestion would be welcome, even the ones I have already tried in case I did it wrong. Please suggest. Thanks for reading! :)
 

Aravind V Nair

Honorable
May 27, 2013
23
0
10,520
1
Here's what I did and it's been perfectly working for me:


Step 1: Open Terminal and paste
Code:
sudo nano /etc/default/grub
Step 2: Update the line
Code:
GRUB_CMDLINE_LINUX_DEFAULT
to include
Code:
nomodeset
.
Step 3:
Code:
sudo update-grub && sudo reboot
At this point, TeamViewer should be able to load, and you should be able to log in. But the resolution is bad and the graphics aren't good either.

Step 4: Open Terminal and paste
Code:
sudo apt install xserver-xorg-video-dummy -y
Step 5: Make a script called
Code:
monitor.sh
with contents as
Code:
sudo rm /usr/share/X11/xorg.conf.d/xorg.conf
and
Code:
nomonitor.sh
with contents as
Code:
sudo cp xorg.conf /usr/share/X11/xorg.conf.d/
. This can be kept in home folder for easier accessibility.


Step 6: The contents of
Code:
xorg.conf
are as follows:


Code:
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
Step 7: Now all that's required is to run one of those scripts according to the situation (monitor connected or disconnected) and TeamViewer, VNC, AnyDesk, etc will start working fine with any resolution.
 

Aravind V Nair

Honorable
May 27, 2013
23
0
10,520
1
Dummy HDMI Plug
plus $10 wireless media keyboard/mouse combo (or an old Logitech receiver)
@Alabalcho Thanks, although that would work, I'm looking towards a software-based approach. My keyboard and mouse work fine, but I'm unable to login when I install the 'xserver-xorg-video-dummy ' package. Other than that, no issues with the keyboard and mouse.

As for the display, when I install the package, it works as intended and as I expect it to. I can confirm the system does boot up without monitor because I can SSH into it. But TeamViewer doesn't capture it as there is nothing to mirror. I am trying to get 'xserver-xorg-video-dummy ' to work properly now. Or any alternatives to that so that there's a virtual monitor for TeamViewer to capture. That package works fine, just that I am unable to login. When I try to log in, it accepts the password and then puts me back to the lock screen. Any ideas or suggestions?
 

Aravind V Nair

Honorable
May 27, 2013
23
0
10,520
1
If you are able to login thru SSH, why you need TV then? You can tunnel X thru SSH connection (not that I've done that, but I recall seeing tutorials / posts how to do it)
@Alabalcho Yes, I could forward the X session, but I prefer TeamViewer as it has WOL, FTP, VPN and everything that I need baked in. I figured out how to get it working. I changed my GRUB config. I shall post the answer once I'm done testing in a few days.
 

Aravind V Nair

Honorable
May 27, 2013
23
0
10,520
1
Here's what I did and it's been perfectly working for me:


Step 1: Open Terminal and paste
Code:
sudo nano /etc/default/grub
Step 2: Update the line
Code:
GRUB_CMDLINE_LINUX_DEFAULT
to include
Code:
nomodeset
.
Step 3:
Code:
sudo update-grub && sudo reboot
At this point, TeamViewer should be able to load, and you should be able to log in. But the resolution is bad and the graphics aren't good either.

Step 4: Open Terminal and paste
Code:
sudo apt install xserver-xorg-video-dummy -y
Step 5: Make a script called
Code:
monitor.sh
with contents as
Code:
sudo rm /usr/share/X11/xorg.conf.d/xorg.conf
and
Code:
nomonitor.sh
with contents as
Code:
sudo cp xorg.conf /usr/share/X11/xorg.conf.d/
. This can be kept in home folder for easier accessibility.


Step 6: The contents of
Code:
xorg.conf
are as follows:


Code:
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
Step 7: Now all that's required is to run one of those scripts according to the situation (monitor connected or disconnected) and TeamViewer, VNC, AnyDesk, etc will start working fine with any resolution.
 

ASK THE COMMUNITY

TRENDING THREADS