Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: VNC on headless 18.04 ??

  1. #1
    Join Date
    Nov 2010
    Beans
    24

    VNC on headless 18.04 ??

    I have a Ubuntu 18.04 desktop on a machine that I also want to use headless with VNC.

    Got it working when a display is connected, but if no monitor attached the VNC connection is refused.

    How can I make it work both when a monitor is attached and also without? I don't mind rebooting.

    I have the Screen Sharing option turned on and my .vnc/startup file (probably wrong?) looks like this:

    Code:
    #!/bin/sh
    
    export XKL_XMODMAP_DISABLE=1
    unset SESSION_MANAGER
    unset DBUS_SESSION_BUS_ADDRESS
    
    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    xsetroot -solid grey
    vncconfig -iconic &
    
    #xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    #twm &
    
    gnome-panel &
    gnome-settings-daemon &
    metacity &
    nautilus &
    gnome-terminal &
    What do I need to change to get this to work?

    Thanks in advance!

  2. #2
    Join Date
    Apr 2015
    Beans
    118

    Re: VNC on headless 18.04 ??

    I believe that Screen Sharing aka vino-server uses xstartup. If disconnecting the monitor after connecting is not an acceptable solution then you can try installing tigervnc-standalone-server. Tigervnc does use xstartup. Rename your .vnc folder before installation. During config a new .vnc folder will be created with a default xstartup that should work.

  3. #3
    Join Date
    Nov 2010
    Beans
    24

    Re: VNC on headless 18.04 ??

    Starting the machine with a monitor and then disconnecting it is not an option.

    I did what you suggested, and then tried starting the server by entering vncserver in the shell.

    I get the following:

    vncserver: Failed command '/etc/X11/Xvnc-session': 256!
    And

    Can't exec "/usr/bin/xterm": No such file or directory at /usr/bin/tigervncserver line 877.
    And

    vncext: VNC extension running!
    vncext: Listening for VNC connections on local interface(s), port 5901
    vncext: created VNC server for screen 0
    XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":1"
    after 175 requests (175 known processed) with 0 events remaining.
    Killing Xtigervnc process ID 3064... which seems to be deadlocked. Using SIGKILL!
    I tried restarting without a monitor and connecting via VNC, but I just get the same error as before.

    Now what?

  4. #4
    Join Date
    Nov 2009
    Beans
    Hidden!
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: VNC on headless 18.04 ??

    if it's "headless", why do you need a desktop then? desktop is there to help you interact with PC via monitor and input devices, if you are not using monitor then there is no point in having a desktop.

    if you need a GUI for server maintenance then it is better to use a webgui. there are plenty out there, but i would say Zentyal and Ajenti are both worth a look. or if you don't mind Debian then Openmediavault is good, while Nethserver works on the CentoS and is also aimed at users that want to avoid CLI as much as possible. there are also a bunch of other WEB GUIs available.

    most server setup is done in config files so the GUI is not really that necessary, though it can come in handy.
    Read the easy to understand, lots of pics Ubuntu manual.
    Do i need antivirus/firewall in linux?
    Full disk backup (newer kernel -> suitable for newer PC): Clonezilla
    User friendly full disk backup: Rescuezilla

  5. #5
    Join Date
    Nov 2010
    Beans
    24

    Re: VNC on headless 18.04 ??

    Well, I could explain the reasons for VNC, but they are tangential. I have Webmin installed already.

    Is it not possible to just set up VNC on Ubuntu so that it works whether I have a monitor connected or not?

    Should I be looking at a different distro with a community that can speak to this kind of issue?

  6. #6
    Join Date
    Apr 2015
    Beans
    118

    Re: VNC on headless 18.04 ??

    What is the output of

    ls -la ~/.vnc
    cat ~/.vnc/thefilenamehere.log
    cat ~/.vnc/xstartup

  7. #7
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    13,616
    Distro
    Ubuntu

    Re: VNC on headless 18.04 ??

    You usually need the xserver-xorg-video-dummy package if you want to run headless.
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  8. #8
    Join Date
    Nov 2010
    Beans
    24

    Re: VNC on headless 18.04 ??

    Thanks much for your messages.

    I tried installing xserver-xorg-video-dummy and then rebooting. No change.

    The files look like this:

    Code:
    me@MyServer:~$ ls -la ~/.vnc
    total 20
    drwxr-xr-x  2 me me 4096 Jun  8 14:37 .
    drwxr-xr-x 22 me me 4096 Jun  8 18:03 ..
    -rw-r--r--  1 me me 5768 Jun  8 14:37 MyServer:1.log
    -rw-------  1 me me    8 Jun  8 08:48 passwd
    
    me@MyServer:~$ cat ~/.vnc/MyServer:1.log
    
    Xvnc TigerVNC 1.7.0 - built Dec  5 2017 09:25:01
    Copyright (C) 1999-2016 TigerVNC Team and many others (see README.txt)
    See http://www.tigervnc.org for information on TigerVNC.
    Underlying X server release 11905000, The X.Org Foundation
    
    Fri Jun  8 08:48:59 2018
     vncext:      VNC extension running!
     vncext:      Listening for VNC connections on local interface(s), port 5901
     vncext:      created VNC server for screen 0
    XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":1"
          after 175 requests (175 known processed) with 0 events remaining.
    Killing Xtigervnc process ID 4044... which seems to be deadlocked. Using SIGKILL!
    
    me@MyServer:~$ cat ~/.vnc/xstartup
    cat: /home/me/.vnc/xstartup: No such file or directory
    I guess the xstartup file is missing because I haven't gotten tigervnc to run without exiting?

    Thanks again!
    Last edited by modomobo; June 9th, 2018 at 03:48 AM.

  9. #9
    Join Date
    Apr 2015
    Beans
    118

    Re: VNC on headless 18.04 ??

    Normally xstartup in created when you run vncpasswd.

    Code:
    #!/bin/sh
    unset SESSION_MANAGER
    unset DBUS_SESSION_BUS_ADDRESS
    exec gnome-session

  10. #10
    Join Date
    Nov 2010
    Beans
    24

    Re: VNC on headless 18.04 ??

    I tried vncpasswd. It didn't create ~/.vnc/xstartup.

    I created the file using nano, and added the content suggested by nlee2 (above). Rebooted.

    Tried vncserver :1 to start the server (why doesn't it start by itself?).

    Still can't connect from my vnc client.

    Tried: sudo netstat -nlp | grep 5901

    tcp 0 0 127.0.0.1:5901 0.0.0.0:* LISTEN 1686/Xtigervnc
    tcp6 0 0 ::1:5901 :::* LISTEN 1686/Xtigervnc

    So, it's only listening on the loopback address? How do I get it to listen on the regular server address?

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •