使用vnc远程访问centos7桌面

大半年前就想在通过vnc远程控制centos7的桌面,但是半年来试了好多次网上的教程都没有成功过,很是郁闷。今天终于发现了tigervnc简单的使用方法,记录一下。
网上很多的教程都是安装完tigervnc-server后,将/lib/systemd/system/[email protected]复制到/lib/systemd/system/vncserver@:1.service,但我试过了似乎这种方法并不起作用
我的操作步骤如下:

1.安装vncserver
yum install tigervnc-server

2.我们只需要新建一个vnc用户和密码,即(jison为我的用户名)
vncpasswd jison
然后按提示输入设置的密码

3.接着使用以下命令启动vncserver即可
vncserver :1
启动时终端输出类似以下的信息

New 'localhost.localdomain:1 (jison)' desktop is localhost.localdomain:1

Starting applications specified in /jison/.vnc/xstartup
Log file is /home/jison/.vnc/localhost.localdomain:1.log

4.然后就可以使用vnc viewer访问centos7的桌面了,访问的用户即为启动vncserver的用户,密码为第二步设置的密码
访问的方法是"ip:1",以ip为192.168.1.100为例,即为192.168.1.100:1

5.关闭vncserver,输入以下命令
vncserver -kill :1
关闭时终端输出类似以下的信息
Killing Xvnc process ID 1826

猜你喜欢

转载自jisonami.iteye.com/blog/2217972