linux启动vnc server

在Windows下安装了VNC之后,第一次连接到相应的linux服务器时,需要启动linux上相应的服务,下面是启动步骤:

1、对于普通用户而言,以下两个步骤就可以了

[root@localhost /]#su ceboy    #ceboy 是用户名
[ceboy@localhost /]$ vncserver

You will require a password to access your desktops.
Password: 123456            #输入vnc 连接密码
Verify: 123456                 #确认vnc密码

xauth: creating new authority file /home/ceboy/.Xauthority
New ‘localhost.localdomain:2 (ceboy)’ desktop is localhost.localdomain:2
Creating default startup script /home/ceboy/.vnc/xstartup
Starting applications specified in /home/ceboy/.vnc/xstartup
Log file is /home/ceboy/.vnc/localhost.localdomain:2.log

通过上面的步骤,就在linux服务器上启动了一个vnc 服务,这个服务的端口是2(‘localhost.localdomain:2 (ceboy)’ )

2、通过下面的命令可以查看目前已经启动的vnc服务,不同的用户一般使用的端口不同。

1.[root@anhnfts nutch]# ps -ef|grep vnc  
2.root     19742     1  0 15:37 pts/2    00:00:01 Xvnc :2 -desktop anhnfts:2 (nutch) -httpd /usr/share/vnc/classes -auth /root/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5902 -pn  
3.root     26721 19492  0 15:48 pts/2    00:00:00 grep vnc 

其中, 00:00:01 Xvnc :2 -desktop这个里面的2就是你启动的vnc 服务的端口

3、在Windows上通过VNC连接相应服务器的时候,有个vnc server的框需要输入,那么根据上面的步骤,输入应该是:192.168.xx.xx:2

reference:

vnc server配置、启动、重启与连接

vnc 常用操作笔记,启动vncserver,指定端口

发布了29 篇原创文章 · 获赞 16 · 访问量 6万+

猜你喜欢

转载自blog.csdn.net/u011412768/article/details/103048945