Sử dụng VNC server để Remote Desktop đến server Linux
Sử dụng VNC server để Remote Desktop Linux
Trong bài hướng dẫn này mình sẽ giới thiệu các bạn 1 cách thức để remote desktop trên linux sử dụng VNC ( Virtual Network Computing )
Link tham khảo
Step 1: Install Required Packages
Most of Linux servers doesn’t have desktop installed on their system. So make sure you have installed else use following command to install it.
Now install few required packages for vnc-server
# yum install pixman pixman-devel libXfont
Step 2: Install VNC Server
After installing required packages, lets install vnc-server in your system. vnc-server is available under default yum repositories.
# yum install vnc-server
On CentOS/RHEL 6, you will see that tigervnc-server package will be installed.
Step 3: Create User for VNC
Lets’ create few users for connecting through vnc. You can also use existing system users by connecting through vnc, In that case we only need to set vncpasswd for that account.
Now set the vnc password for all accounts need to connect through vnc.
Step 4: Configure VNC Server for Users
Now edit /etc/sysconfig/vncservers configuration file and add the following to the end of the file.
Where VNCSERVERS is the list of users need to connect, VNCSERVERARGS defined the screen size. Like user1 have a 800×600 screen, and user2 have 1024×768 screen size on his client.
Now start vnc-server service using following command and check the output
As per above output, you can see that user1 desktop is available on :1 and user2 desktop is available on :2. We will use :1 to connect to user1 and :2 to connect to user2.
Step 5: Connect VNC Server using VNC Viewer
To access from remote Linux system use following command.
# vncviewer 192.168.1.11:1
To access remote desktop on vnc-server from windows system, you must have vnc-viewer installed on your system. There are various vnc viewer available to use. Download any one and install on your system, for example:
After installing vnc viewer connect to your system, In below example we are connected to user1 (:1).
Now enter vnc password of account assigned with vncpasswd command.
You are connected to x windows system of your Linux machine.