linux下使用VNC

36 篇文章 0 订阅
2 篇文章 0 订阅

安装:

[root@localhost ~]# vncserver

You will require a password to access your desktops.

Password:
Verify:

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

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:1.log

查看进程:

[root@localhost ~]# ps -ef|grep vnc
root     23180     1  6 13:57 pts/1    00:00:00 Xvnc :1 -desktop localhost.localdomain:1 (root) -httpd /usr/share/vnc/classes -auth /root/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -pn
root     23184     1  0 13:57 pts/1    00:00:00 vncconfig -iconic
root     23219 17944  0 13:57 pts/1    00:00:00 grep vnc

 

修改管理窗口:

以gnome管理
[root@localhost ~]# vi /root/.vnc/xstartup

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
gnome-session &
~
~
~
~
~
~
~
~
~
~
".vnc/xstartup" 13L, 351C written

重启服务:
[root@localhost ~]# service vncserver restart
Shutting down VNC server: [  OK  ]
Starting VNC server: [  OK  ]
[root@localhost ~]#

或者这样重启:

[root@localhost .vnc]# vncserver -kill :1
Killing Xvnc process ID 23180
[root@localhost .vnc]# vncserver -kill :2
Killing Xvnc process ID 23243
[root@localhost .vnc]# vncserver -kill :3

Can't find file /root/.vnc/localhost.localdomain:3.pid
You'll have to kill the Xvnc process manually

[root@localhost .vnc]# vncserver

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

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

 

访问VNC服务器

在客户端安装VNC viewer,然后打开:

中间填要访问的IP:1

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值