Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install vnc on linux

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the knowledge of "how to install vnc on linux". In the operation of practical cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The method of installing vnc on linux: 1. Install vnc;2 with "yum install vnc vnc-server" command and install "tigervnc-server" with "yum install tightvnc-server" command.

The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

How to install vnc on linux

The first thing to know is what VNC is. VNC (Virtual Network Computing), a display screen sharing and remote operation software using RFB protocol. It is independent of the operating system, so it can be used across platforms. For example, you can use windows to connect to a Linux computer through VNC Viewer.

The VNC system consists of a client, a server, and a protocol. The purpose of the server is to share the screen it runs, and the server passively allows the client to control it.

Let's talk about how to install VNC on Linux.

1. First, check whether the VNC service is installed: enter the command: rpm-qa | grep vnc, as shown in the following figure, it has been installed. If you don't take the next step,

1-1, install VNC: [root @ localhost ~] # yum install vnc vnc-server

Install tigervnc-server: [root@localhost ~] # yum install tightvnc-server

Set the VNC password for the first time (remember the password here and use it when you come back to use VNC Viewer): [root@localhost ~] # vncserver, note that the password here should be at least 6 digits

You can also create multiple desktops and execute multiple vncserver commands.

2, configure the firewall.

If the firewall is not configured, there is no way for the client VNC to connect to the Linux. In fact, VNC, just like our remote desktops, when you want to remotely your own desktop, the first thing is to go to the firewall to change some configuration, right? Otherwise, the remote connection is not successful, the reason is the same.

Configure firewall commands:

[root@localhost] # iptables-I INPUT-p tcp-dport 5901-j ACCEPT

[root@localhost] # iptables-I INPUT-p tcp-dport 5801-j ACCEPT

Here, two desktops are added. The corresponding relationship between desktop and port is: desktop 1 corresponds to 5901, desktop 2 corresponds to 5801, or you can set it yourself.

3. Configure desktop client. Enter the command: [root@localhost ~] # vi / root/.vnc/xstartup, and the interface is as follows:

Press I in this interface to enter the editing state, and add the following at the end:

[- x / etc/vnc/xstartup] & & exec / etc/vnc/xstartup

[- r HOME/.Xresources] & & xrdbHOME/.Xresources] & & xrdbHOME/.Xresources

Xsetroot-solid grey

Vncconfig-iconic &

Xterm-geometry 80x24+10+10-ls-title "$VNCDESKTOP Desktop" &

Gnome-session &

The modified interface is shown in the figure:

This step is installed only if the Gnome desktop environment is installed in Linux

3-1 to see if the Gnome desktop environment is installed: enter the command: [root@localhost ~] # yum grouplist

Or [root@localhost ~] # yum grouplist | more

The gnome desktop environment is not installed to show:

If the desktop environment is installed, it shows:

3-2, install the gnome desktop graphical environment commands (this process is relatively long and there are more things to install):

[root@localhost ~] # yum groupinstall "GNOME Desktop"

3-3, shut down and restart the service

Shut down the service: Vncserver-kill: 1

Restart the service: vncserver: 1

Use vncserver-list to see how many desktops are started

At this point, the VNC installation is complete. But there is no change on Linux, and I still feel guilty. Just like on the first remote desktop, I finished the configuration, but I don't know whether it was successful or not, so I need to connect with another computer to see if it can be successful.

4-1, install VNC Viewer on your computer:

4-2, open and create a new connection, as shown in the figure:

4-3, find the VNC you created, as shown in the following figure, right-click, and select Connect:

4-4, enter the password you entered when you set up VNC (if you forget, please see the introduction in 1-1):

4-5. When you get to this interface, select Continue:

And then it worked.

After each boot, start the VNC service manually and enter the command): vncserver or vncserver: 1

This is the end of "how to install vnc on linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report