首页 > 窍门 > 科技数码

Ubuntu下开启vnc的tip方法 Ubuntuvnc

来源: 更新时间:2023-11-06 00:13:56
The Beginning

安装方法

代码如下:

sudo apt-get install vnc4server vnc-java

默认端口从5901开始

修改 ~/.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 &

x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

x-server-manager &

这个配置是不能进入桌面的

把最后一行x-server-manager 修改为gnome-session

配置文件修改后

代码如下:

# 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 &

这时候重启服务即可

代码如下:

[root@fancyos ~]# vncserver -kill :1

[root@fancyos ~]# vncserver :1

THE END

TAG:代码  重启  配置文件  

猜你喜欢

相关文章