linux下搭建vnc服务器,linux下搭建Vncserver
1、啟動vncserver
:
Vncserver start
[root@zhou .vnc]# vncserver
start
You will require a password to access
your desktops.
Password:
Verify:
usage: vncserver
[:] [-nohttpd] [-name
] [-depth
]
[-geometry
x]
[-pixelformat rgbNNN|bgrNNN]
...
vncserver -kill
第一次啟動vncserver 系統會提示你輸入密碼;若不是第一次登入vncserver 可以通過把/root/.vnc/passwd 刪除。再次運行vncserver start。
2、通過VNC Viewer
登入系統(命令行界面)
[root@zhou .vnc]# vncserver
:1
New 'zhou.com:1 (root)' desktop is
zhou.com:1
Starting applications specified in
/root/.vnc/xstartup
Log file is
/root/.vnc/zhou.com:1.log
3、通過VNC Viewer
登入系統(圖形化界面)
修改/root/.vnc/xstartup
[root@zhou .vnc]# vi 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
&
~
[root@zhou .vnc]# vncserver -kill
:1
Killing Xvnc process ID
17929
[root@zhou .vnc]# ls
-l
總計 40
-rw------- 1 root root
8 08-15 10:14 passwd
-rwxr-xr-x 1 root root 352
08-15 10:24 xstartup
-rw-r--r-- 1 root root 1301 08-15 10:26
zhou.com:1.log
-rw-r--r-- 1 root root 27113 08-15
08:21 zhou.com:2.log
[root@zhou .vnc]# vncserver
:1
New 'zhou.com:1 (root)' desktop is
zhou.com:1
Starting applications specified in
/root/.vnc/xstartup
Log file is
/root/.vnc/zhou.com:1.log
4、關閉vncserver
[root@zhou ~]# vncserver
:1
New 'zhou.com:1 (root)' desktop is
zhou.com:1
Starting applications specified in
/root/.vnc/xstartup
Log file is
/root/.vnc/zhou.com:1.log
[root@zhou ~]# ps aux | grep
vnc
root
10897
1.1
0.6
11556 7268
pts/1
S
04:13
0:00 Xvnc :1 -desktop zhou.com:1 (root) -httpd
/usr/share/vnc/classes -auth /root/.Xauthority -geometry 1024x768
-depth 16 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901
-pn
root
10901
0.1
0.1
4276 1308
pts/1
S
04:13
0:00 vncconfig -iconic
root
11009
0.0
0.0
3924 664
pts/1
R+
04:13
0:00 grep vnc
[root@zhou ~]# vncserver -kill
:1
Killing Xvnc process ID
10897
[root@zhou ~]# ps aux | grep
vnc
root
11025
0.0
0.0
3924 688
pts/1
R+
04:14
0:00 grep vnc
[root@zhou ~]#
##############################################################
服務器典型配置
[root@ytxt ~]# cat ~/.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 &
總結
以上是生活随笔為你收集整理的linux下搭建vnc服务器,linux下搭建Vncserver的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oracle脚本刷错了怎么办,Oracl
- 下一篇: linux 其他常用命令