Software & Apps Linux How to Use the VNC Remote Desktop Functionality on Linux Commands, Syntax, and Examples by Juergen Haas Writer Former Lifewire writer Juergen Haas is a software developer, data scientist, and a fan of the Linux operating system. our editorial process Juergen Haas Updated on March 23, 2020 Tweet Share Email Linux Switching from Windows Virtual network computing software initiates a desktop environment on one machine sourced from other computers through an internet connection. VNC supports persistent desktops even after disconnection, so you can continue working exactly where you left off when you re-connect. How Virtual Network Computing Works Install vncserver on the server machine (if not already installed) and a VNC viewer on the client machine (see realVNC for a popular version of the VNC software). It's helpful to use ssh to connect from your viewer machine to the server. The PuTTY package works great for this purpose. Launch an ssh session, then login to the server and, from the shell prompt, enter: vncserverNew 'server1.org1.com:6" (juser)' desktop is server1.org1.com.6 Before running vncserver, set up the initialization file ~/.vnc/xstartup, which should be created in your home directory. This file contains initialization commands, such as # Execute common xstartup file [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup# Load .Xresources file[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources# Run the vncconfig helper to enable clipboard transfers and control of the desktopvncconfig -iconic &# Launch a GNOME desktopexec gnome-session & Now a virtual desktop runs on the server waiting to be displayed on your local computer. If you installed the realVNC software or downloaded a VNC viewer, run this viewer, and enter the server and display number as illustrated in this example: server1.org1.com:6 The viewer software asks for a password. The first time you use VNC on this server, enter a new password, which will be saved in the .vnc folder. The password is for VNC connections and not related to your user account on the server. After a period of inactivity, you may be asked to enter your account password as well to authorize the server access. After the password is accepted, the desktop window appears with all the specified graphical user interface elements. Disconnect from the desktop by closing the desktop window. Terminate the VNC server process by entering the following command in a shell window on the server: vncserver -kill : For example: vncserver -kill :6 Was this page helpful? Thanks for letting us know! Get the Latest Tech News Delivered Every Day Email Address Sign up There was an error. Please try again. You're in! Thanks for signing up. There was an error. Please try again. Thank you for signing up. Tell us why! Other Not enough details Hard to understand Submit