Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33

Thread: I can't start tightVNC at startup with systemd

  1. #1
    Join Date
    Feb 2023
    Beans
    19

    Smile I can't start tightVNC at startup with systemd

    Hello !

    My system : Ubuntu 22.04.2 LTS (GNU/Linux 5.19.0-32-generic x86_64)

    After installing Tightvnc, I scrupulously followed the instructions to fill in a service file so that my vnc server restarts every time ubuntu starts (Recommendation from this site, and many other tests: https://www.digitalocean.com/communi...n-ubuntu-22-04):

    [Unit]
    Description=Start TightVNC server at startup
    After=syslog.target network.target

    [Service]
    Type=forking
    User=mysusername
    Group=mysusername
    WorkingDirectory=/home/mysusername

    PIDFile=/home/mysusername/.vnc/%H:%i.pid
    ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
    ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 -localhost :%i
    ExecStop=/usr/bin/vncserver -kill :%i

    [Install]
    WantedBy=multi-user.target

    The service starts and port 5901 is busy, but I can't access my system through a vnc viewer.

    The service is running and port 5901 is busy, but I can't access my system through a vnc viewer, but when I run a simple command line via ssh "vncserver:1" it works. Can you help me?

    Good day to you

  2. #2
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: I can't start tightVNC at startup with systemd

    Please post the results of
    Code:
    echo $USER
    \...becuase in your post, the user name 'myusername' is probably not a valid user of your system...
    Last edited by MAFoElffen; February 25th, 2023 at 12:28 AM.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  3. #3
    Join Date
    Feb 2023
    Beans
    19

    Re: I can't start tightVNC at startup with systemd

    In fact, but i had just replace my real username with "myusername" for this post

  4. #4
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: I can't start tightVNC at startup with systemd

    Oh, okay. Then please show the output of
    Code:
    sudo systemctl status vncserver@1.service
    Then any errors on
    Code:
    ssh -L 59000:localhost:5901 -C -N -l myusername your_server_ip
    And while the tunnel is established
    Code:
    sudo lsof -i -n | grep '\<ssh\>\|\<sshd\>'

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  5. #5
    Join Date
    Feb 2023
    Beans
    19

    Re: I can't start tightVNC at startup with systemd

    Hello,

    Thank you for you answer MAFo, however i can start my service now, i must change exectstart= command line with : ExecStart=/usr/bin/vncserver :%i

    And it's ok. But the service is launch without sudo rights.

    I had try to change the line exectstart with
    [COLOR=var(--black-800)]ExecStart=/usr/bin/sudo [/COLOR]/usr/bin/vncserver :%i

    But nothing... Though the service doesn't start, maybe because de sudo command ask my passwd ?

    Zenvice

  6. #6
    Join Date
    May 2010
    Beans
    3,313

    Re: I can't start tightVNC at startup with systemd

    What are you wanting to do on the remote system? There may be a sleeker solution to what you want to do

  7. #7
    Join Date
    Feb 2023
    Beans
    19

    Re: I can't start tightVNC at startup with systemd

    I m looking for manage my serveur altought gui for my downloads, and soft on wine for exemple.

    So, automating server startup in sudo would be great !

  8. #8
    Join Date
    May 2010
    Beans
    3,313

    Re: I can't start tightVNC at startup with systemd

    What do you mean "GUI for downloads"? There are download managers with Web interfaces. Torrent apps also have Web interfaces too....?

  9. #9
    Join Date
    Feb 2023
    Beans
    19

    Re: I can't start tightVNC at startup with systemd

    yes torrents with qtorrent and browser or metatrader 4 with wine

  10. #10
    Join Date
    May 2010
    Beans
    3,313

    Re: I can't start tightVNC at startup with systemd

    Quote Originally Posted by zenvice View Post
    yes torrents with qtorrent and browser or metatrader 4 with wine

    Qbittorrent has.a.web UI
    You can manage your torrents easily with a Web browser and changing "localhost" in the usual browser access to the IP of the remote system. No need for VNC there.

Page 1 of 4 123 ... 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
  •