Configure the VNC viewer on Redhat Linux in Azure cloud.

  1. Login in Azure and create a VM machine having OS Redhat Linux. I created my machine with username and password.
Creating VM in Azure choose Password

2. Connect the virtual machine by choose ssh for linux.

3. Following SSH window will open with all connectivity detail

3. Install the PUTTY for connectivity and VNCVIEWER for gui mode.

4. Open the Putty app and connect with VM. Enter Password on putty window.

5. install the GUI Graphic mode in Redhat Linux by default its not installed. It will take 15 minutes.

sudo yum -y group install GNOME base-x

6. Enable the GUI graphic mode for Redhat Linux.

sudo systemctl set-default graphical.target
sudo systemctl isolate graphical.target

Example:
[sunny@VM1 ~]$ sudo systemctl set-default graphical.target
Removed /etc/systemd/system/default.target.
Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/graphical.target.
[sunny@VM1 ~]$ sudo systemctl isolate graphical.target

7. Install the Tiger VNC software

sudo yum -y install tigervnc-server tigervnc tigervnc-server-module

8. Set the Password for VNC for current User.

$ vncpasswd

Example:
[sunny@VM1 ~]$ vncpasswd
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
A view-only password is not used
[sunny@VM1 ~]$

9. Enable the firewall for the 5901 ports.

sudo firewall-cmd --permanent --add-port=5901/tcp
sudo firewall-cmd --reload

Example:
[sunny@VM1 ~]$ sudo firewall-cmd --permanent --add-port=5901/tcp
success
[sunny@VM1 ~]$ sudo firewall-cmd --reload
success

10. Start the VNCSERVER service.

$ vncserver

Example:
[sunny@VM1 ~]$ vncserver
xauth:  file /home/sunny/.Xauthority does not exist

New 'VM1:1 (sunny)' desktop is VM1:1

Creating default startup script /home/sunny/.vnc/xstartup
Creating default config /home/sunny/.vnc/config
Starting applications specified in /home/sunny/.vnc/xstartup
Log file is /home/sunny/.vnc/VM1:1.log

11. Check VNC server start listening with following command:

[sunny@VM1 ~]$ netstat -tlnp
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:5355            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:5901            0.0.0.0:*               LISTEN      35193/Xvnc

11. Go to the Network security Setting in Azure Portal. Add new inbound network policy for PORT 5901 with 100 priority for that virtual machine.

11. Add Inbound port rule as follows and press ADD button. It will enable the PORT 5901 for incoming connection to VM.

12. Start the VNC Viewer for connecting.

13. You can see the VNC Viewer show you the GUI mode of Linux.

Note: If it asking for administrator username and password, wait for 5 min it autmatically go or fire following command with your user without sudo.

systemctl set-default graphical.target

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.