Linux配置vnc

[root@centos ~]# vncserver

You will require a password to access your desktops.

Password:123456
Verify:123456

[root@centos ~]# vi /etc/sysconfig/vncservers

# VNCSERVERS="1:myusername"
VNCSERVERS="1:root"

# VNCSERVERARGS[1]="-geometry 800x600"


-alwaysshared代表允许多用户同时登录 -depth代为色深,参数有8,16,24,32。

[root@centos .vnc]$ 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" &
#gnome-session & #set starting GNOME desktop
startkde &   #kde desktop
#twm &     #Text interface



重启VNC即可

#service vncserver start/stop/restart

打开VNC

输入IP:1

原文地址:https://www.cnblogs.com/chinajsks/p/2747973.html