Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Help about MediaWiki
FUTO
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Introduction to a Self Managed Life: a 13 hour & 28 minute presentation by FUTO software
(section)
Main Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Step 6: Start the GUI == To start the graphical interface, use the following command: <pre>startx</pre> <blockquote>'''Note:''' We will be using the GUI for Virtual Machine Manager. Any time you are NOT using this, exit the GUI (right click the desktop & log out), then type <code>exit</code> from the command line terminal so your machine is not logged in. Even if someone breaks into your house, they’ll have physical access to your computer; but that doesn’t mean they have easy access to your encrypted data. </blockquote> <span id="optional-remote-desktop-access-with-x11vnc-and-tigervnc"></span> ==== 6.1(OPTIONAL): Remote Desktop Access with x11vnc and TigerVNC ==== x11vnc is like teamviewer if teamviewer were open source and 50x slower. x11vnc allows you to connect to your server’s GUI for remote access, as if you were right in front of the computer, without having to be in the room with your computer. Up until now, we have been SSHing into the machine in order to enter terminal commands, but normal SSH won’t work if we want to use the graphical user interface, see a mouse cursor, etc. <blockquote>'''Note:''' If you are ok with sitting in front of your server computer with a keyboard, mouse, & monitor plugged into it when using virtual machine manager, this step is ''unnecessary'' and you can feel free to skip it. </blockquote> This will walk you through setting up remote desktop access to your Ubuntu Server using x11vnc and TigerVNC. I like using '''virtual machine manager''' GUI to install virtual machines on the main server. Since we keep going to the GUI to install virtual machines & use '''virtual machine manager''' via the GUI, we’re stuck sitting in front of the server, which sucks if it’s in a closet or garage. Here’s how you can connect to it to view what is on its screen from another computer. <span id="installing-x11vnc-on-ubuntu-server"></span> ==== 6.2 Installing x11vnc on Ubuntu Server ==== To install x11vnc, run the following command in your terminal: <pre>sudo apt update && sudo apt install x11vnc</pre> This will install the x11vnc package and its dependencies on your server. <span id="set-a-password-for-vnc-authentication"></span> ==== 6.3 Set a Password for VNC Authentication ==== x11vnc uses a password for authentication, and you can set this password as follows: <pre>x11vnc -storepasswd</pre> You will be prompted to enter a password. This password will be saved in the default location <code>~/.vnc/passwd</code>. <span id="set-x11vnc-to-listen-on-all-interfaces-on-port-5920"></span> ==== 6.4 Set x11vnc to Listen on All Interfaces on Port 5920 ==== Open a terminal and run the following: <pre>x11vnc -rfbport 5920 -usepw -auth ~/.Xauthority -display :0 -forever -norc -noxdamage -shared</pre> Here is why this helps clients like Remmina connect: '''1. <code>-rfbport 5920</code>''' This sets the '''port''' on which the VNC server will listen for connections. VNC defaults to port <code>5900</code>, but I like to use a non-standard one because I am strange. '''2. <code>-usepw</code>''' This option enables '''password authentication''' for VNC clients. It requires you to set a password using <code>x11vnc -storepasswd</code> beforehand. Use this to set a VNC password. * Password authentication is standard for VNC clients like Remmina. Without this, some clients might reject the connection for security reasons. And it’s just good practice. '''3. <code>-auth ~/.Xauthority</code>''' The <code>-auth</code> option tells <code>x11vnc</code> which '''authentication file''' to use to access your X session. The file path <code>/run/user/$(id -u)/gdm/Xauthority</code> refers to authorization for the user running the current display session managed by GDM (your display manager). If you’re using LightDM or another manager, the path might differ. * '''Why it helps''': Instead of relying on <code>-auth guess</code> (which might not always find the right file), specifying the correct <code>Xauthority</code> file guarantees that <code>x11vnc</code> can properly access the graphical session. If <code>x11vnc</code> can’t authenticate the display, no client can connect. '''4. <code>-display :0</code>''' This option specifies which '''X display''' to serve via VNC. The display <code>:0</code> is typically the primary display for your desktop session (the one you see on your monitor). It makes sure <code>x11vnc</code> is connecting to the right graphics session. If it were set to the wrong display, you’d either get a black screen or your client wouldn’t connect at all. '''5. <code>-forever</code> ''' Normally, <code>x11vnc</code> stops running after the client disconnects. The <code>-forever</code> flag keeps it running indefinitely. If you disconnect & reconnect it would suck to have to log back in each time. Without this, <code>x11vnc</code> would stop after Remmina disconnects, and you’d have to restart it manually for every new connection. I like stopping <code>x11vnc</code> once I am done manually. '''6. <code>-norc</code> ''' This option tells <code>x11vnc</code> '''not to load a configuration file''' (which might contain unwanted settings), we are only using the settings in this command line. '''7. <code>-noxdamage</code>''' The <code>Xdamage</code> extension tracks changes to the screen, but sometimes it can cause display corruption or update issues in VNC clients. The <code>-noxdamage</code> flag disables this extension to avoid those problems. Some VNC clients who shall not be named sometimes fk up refreshing the screen when properly when <code>Xdamage</code> is enabled. Disabling it keeps artifacts/stuck screen issues. '''8. <code>-shared</code>''' This option allows '''multiple clients to connect simultaneously''' to the VNC server. If this option isn’t set, only one client can connect at a time, and additional connection attempts (such as from Remmina) would fail. Enabling <code>-shared</code> makes sure that you can connect with multiple devices or clients without being disconnected when another connects. <span id="installing-tigervnc-viewer-on-the-client"></span> ==== 6.5 Installing TigerVNC Viewer on the Client ==== To connect to the VNC server from a client machine, you need a VNC viewer. The following steps will install TigerVNC Viewer (also known as <code>vncviewer</code>) on the client (your GNU/Linux computer you are reading this on): <ol style="list-style-type: decimal;"> <li><p>Update the package list and install TigerVNC Viewer:</p> <pre>sudo apt update && sudo apt install tigervnc-viewer -y</pre></li> <li><p>Once installed, you can use <code>vncviewer</code> to connect to the server.</p></li> <li><p>If you use Windows or a Mac, you’re on your own, my friend. Find a VNC client that doesn’t suck.</p></li></ol> <span id="connecting-to-the-vnc-server"></span> ==== 6.6 Connecting to the VNC Server ==== Now that everything is set up, you can connect to your server. <ol style="list-style-type: decimal;"> <li><p>On your local machine, use the following command:</p> <pre>vncviewer 192.168.5.2:5920 -SecurityTypes VncAuth</pre></li> <li><p>''Note'': Replace <code>192.168.5.2</code> with your server’s actual IP address. In our case, we can also use the domain <code>happycloud.home.arpa</code> since we set up a static mapping earlier for our server in '''pfSense'''.</p></li> <li><p>When prompted, enter the VNC password you set earlier.</p></li></ol> '''You should now have a remote desktop connection to your Ubuntu Server. Remember to start <code>x11vnc</code> after you have logged in & typed <code>startx</code> to start Openbox so it works.''' <span id="step-7-using-openbox"></span>
Summary:
Please note that all contributions to FUTO may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
FUTO:Copyrights
for details).
Do not submit copyrighted work without permission!
To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:
Cancel
Editing help
(opens in new window)