Difference between revisions of "Remote desktop"

From Take-Air Wiki
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{| class="wikitable"
 +
|-
 +
| '''Tested in the following environments'''
 +
|-
 +
| Open.OC2: Jetson Nano Production module, L4T R32.6.1
 +
|-
 +
| Host: VNC Viewer 6.21.406 on Windows 10
 +
|}
 +
 
Reference tutorial: [http://blog.jeffcosta.com/2021/04/05/how-to-setup-tigervnc-on-jetson-nano/ here]
 
Reference tutorial: [http://blog.jeffcosta.com/2021/04/05/how-to-setup-tigervnc-on-jetson-nano/ here]
  
# You will need to connect to the Jetson module over SSH, it requires to know its IP address (e.g. 192.168.1.15) and your username <username>. In a terminal:
+
# You will need to connect to the Jetson module over SSH, it requires to know its IP address (e.g. 192.168.1.15) and your username <<USERNAME>>. In a terminal:
#: <code>ssh <username>@192.168.1.15</code>
+
#: <code>ssh <<USERNAME>>@192.168.1.15</code>
# Use your login and password.
+
# Use your password to start the session.
 
# Install nano, tigervnc-standalone-server and autocutsel:
 
# Install nano, tigervnc-standalone-server and autocutsel:
 
#: <code>sudo apt install nano tigervnc-standalone-server autocutsel</code>
 
#: <code>sudo apt install nano tigervnc-standalone-server autocutsel</code>
Line 30: Line 39:
 
# If it does not exist, create it:
 
# If it does not exist, create it:
 
#: <code>touch ~/.Xresources</code>
 
#: <code>touch ~/.Xresources</code>
# Create a service to make VNC server start automatically:
 
#: <code>sudo nano /etc/systemd/system/vncserver@.service</code>
 
 
# Open VNC conf file:
 
# Open VNC conf file:
 
#: <code>sudo nano /etc/vnc.conf</code>
 
#: <code>sudo nano /etc/vnc.conf</code>
Line 37: Line 44:
 
# Set up the autologin using GDM3:
 
# Set up the autologin using GDM3:
 
#: <code>sudo nano /etc/gdm3/custom.conf</code>
 
#: <code>sudo nano /etc/gdm3/custom.conf</code>
# Set up the autologin using GDM3:
+
# Uncomment the following lines (replace <<USERNAME>> by your username):
#: <code>sudo nano /etc/gdm3/custom.conf</code>
 
# Uncomment the following lines (replace <username> by your username):
 
 
#:<syntaxhighlight lang="bash">AutomaticLoginEnable=true
 
#:<syntaxhighlight lang="bash">AutomaticLoginEnable=true
 
AutomaticLogin=<your username>
 
AutomaticLogin=<your username>
Line 46: Line 51:
 
# Create a service to make VNC server start automatically:
 
# Create a service to make VNC server start automatically:
 
#: <code>sudo nano /etc/systemd/system/vncserver@.service</code>
 
#: <code>sudo nano /etc/systemd/system/vncserver@.service</code>
# Add the following content, and replace <username> by your username :
+
# Add the following content, and replace <<USERNAME>> by your username :
 
#:<syntaxhighlight lang="bash">[Unit]
 
#:<syntaxhighlight lang="bash">[Unit]
 
Description=Start TigerVNC Server at startup
 
Description=Start TigerVNC Server at startup
Line 53: Line 58:
 
[Service]
 
[Service]
 
Type=forking
 
Type=forking
User=<username>
+
User=<<USERNAME>>
Group=<username>
+
Group=<<USERNAME>>
WorkingDirectory=/home/<username>
+
WorkingDirectory=/home/<<USERNAME>>
PIDFile=/home/<username>/.vnc/%H:%i.pid
+
PIDFile=/home/<<USERNAME>>/.vnc/%H:%i.pid
 
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
 
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
 
ExecStart=/usr/bin/vncserver :%i -depth 24 -geometry 1920x1080 -nolisten tcp
 
ExecStart=/usr/bin/vncserver :%i -depth 24 -geometry 1920x1080 -nolisten tcp
Line 71: Line 76:
 
# Service status can be checked using:
 
# Service status can be checked using:
 
#: <code>systemctl status vncserver@1</code>
 
#: <code>systemctl status vncserver@1</code>
 +
# Install VNC viewer on your machine and connect to <code>192.168.1.15:1</code>. 192.168.1.15 is the IP address and :1 is the VNC server to connect to.

Latest revision as of 15:25, 28 October 2021

Tested in the following environments
Open.OC2: Jetson Nano Production module, L4T R32.6.1
Host: VNC Viewer 6.21.406 on Windows 10

Reference tutorial: here

  1. You will need to connect to the Jetson module over SSH, it requires to know its IP address (e.g. 192.168.1.15) and your username <<USERNAME>>. In a terminal:
    ssh <<USERNAME>>@192.168.1.15
  2. Use your password to start the session.
  3. Install nano, tigervnc-standalone-server and autocutsel:
    sudo apt install nano tigervnc-standalone-server autocutsel
  4. Set a password for the VNC server:
    vncpasswd
  5. Create the file ~/.vnc/xstartup using nano:
    nano ~/.vnc/xstartup
  6. Edit with the following content:
    !/bin/sh
    export XDG_RUNTIME_DIR=/run/user/1000
    export XKL_XMODMAP_DISABLE=1
    unset SESSION_MANAGER
    unset DBUS_SESSION_BUS_ADDRESS
    xrdb $HOME/.Xresources
    xsetroot -solid grey
    # copy/paste enablement
    vncconfig -nowin &
    autocutsel -forkgnome-session &
    startlxde &
  7. Save and exit nano: Ctrl+o (o as in Oscar) to save, press Enter to continue, then Ctrl+x to exit
  8. Make xstartup executable:
    chmod +x ~/.vnc/xstartup
  9. Check if .Xresources exists:
    ls -al ~/.Xresources
  10. If it does not exist, create it:
    touch ~/.Xresources
  11. Open VNC conf file:
    sudo nano /etc/vnc.conf
  12. Check if $localhost = "no"; is NOT commented.
  13. Set up the autologin using GDM3:
    sudo nano /etc/gdm3/custom.conf
  14. Uncomment the following lines (replace <<USERNAME>> by your username):
    AutomaticLoginEnable=true
    AutomaticLogin=<your username>
  15. Save and exit nano: Ctrl+o (o as in Oscar) to save, press Enter to continue, then Ctrl+x to exit
  16. Create a service to make VNC server start automatically:
    sudo nano /etc/systemd/system/vncserver@.service
  17. Add the following content, and replace <<USERNAME>> by your username :
    [Unit]
    Description=Start TigerVNC Server at startup
    After=syslog.target network.target
    
    [Service]
    Type=forking
    User=<<USERNAME>>
    Group=<<USERNAME>>
    WorkingDirectory=/home/<<USERNAME>>
    PIDFile=/home/<<USERNAME>>/.vnc/%H:%i.pid
    ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
    ExecStart=/usr/bin/vncserver :%i -depth 24 -geometry 1920x1080 -nolisten tcp
    ExecStop=/usr/bin/vncserver -kill :%i
    
    [Install]
    WantedBy=multi-user.target
  18. Save and exit nano: Ctrl+o (o as in Oscar) to save, press Enter to continue, then Ctrl+x to exit
  19. Load the new service:
    sudo systemctl daemon-reload
    sudo systemctl enable vncserver@1
    sudo systemctl start vncserver@1
  20. Service status can be checked using:
    systemctl status vncserver@1
  21. Install VNC viewer on your machine and connect to 192.168.1.15:1. 192.168.1.15 is the IP address and :1 is the VNC server to connect to.