Debian X版本配置:
1.查看是否安装VNC
# dpkg -l | grep vnc4server
#
以上信息显示未安装vnc4server服务。
2.安装vnc服务和桌面服务
# apt-get update
# apt-get install vnc4server
# apt-get install x-window-system-core
# apt-get install gnome-desktop-environment
执行以上命令,没有安装相关程序,则会自动安装,如果安装了一些程序,不会重复安装,会自动跳过。
3.设置 VNC 密码
# vncserver
You will require a password to access your desktops.
Password:
Verify:
Password too long - only the first 8 characters will be used
xauth: creating new authority file /root/.Xauthority
New 'xxx:1 (root)' desktop is xxx:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/xxx:1.log
这里“Password”是设置vnc的密码,需要输入两边。会在当前用户主目录下 生成 .vnc 目录和配置文件
# vncpasswd
Password:
Verify:
TIPS:如果需要修改vnc密码,则是输入命令:vncpasswd,仍是需要输入两次,设置的密码保存在/root/.vnc/passwd
4.VNC 配置
# cd /root/.vnc/
# ls -l
total 76
-rw-r--r-- 1 root root 1170 Nov 29 20:50 xxx:1.log
-rw-r--r-- 1 root root 5 Nov 29 20:50 xxx:1.pid
-rw------- 1 root root 8 Nov 29 20:51 passwd
-rwxr-xr-x 1 root root 361 Nov 29 20:50 xstartup
TIPS:修改 xstartup 文件 把最后的 x-window-manager & 删掉 加上 gnome-session &
# vim 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 &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &
添加 vncserver 服务
·····························