🔥 Make sure you star the repo to keep up to date with new tips and tricks.
💡 Learn more : VNC to Azure Linux VMs
Author: Kumar Allamraju Twitter: @kumarallamraju
Are you a MAC or Windows User? A big fan of GUI? Tired of SSH'ing to Linux VMs? What if you want to browse the web? VNC comes to the rescue.
The following article was written for Ubuntu VM but a similar process applies to other Linux flavors as well.
Provision a Linux Virtual Machine from Azure Portal or Azure CLI.
Once connected let’s update our sources list and install some extra packages:
$ sudo apt-get update $ sudo apt-get install tightvncserver
Before configuring the VNC server we shoud install one of the favorite desktop environments like Gnome or Xfce. I personally like Gnome. It's beautiful … and heavy! So be patient while everything gets installed..
Now that our instance has a desktop environment let’s make it accessible via VNC. Start the vncserver, and follow the directions to create a password
$ vncserver Note: this password will grant access to your instance, so make sure you remember this password.
If everything went fine your VNC server is now running and listening on port 5901. You can verify this with netcat from the Azure Ubuntu VM:
$ nc localhost 5901 RFB 003.008
You can google search for a VNC client. My favorite one is RealVNC Viewer
Install the VNC Client but don’t try to connect to your server just yet: it will fail as the firewall rules don’t allow it.
Go to your VM's Network Security Group and allow traffic on port 5901
From your local desktop, launch VNC Client
Open a terminal window in the linux vm.
Install your favorite browser
sudo apt-get install firefox
Launch the browser
And voilà! You can now use your favorite Desktop environment on your Azure VM instance.
The VNC tool provides a rich desktop experience, packed with features that will make you more productive. This is especially useful for native Windows or MAC users. Go ahead and give it a try!!