windows上通过vnc连接虚拟机中linux系统

来源:互联网 发布:什么是淘宝店铺维护 编辑:程序博客网 时间:2024/04/29 19:56

闲来无事 看到一款软件 RealVNC 可以连接虚拟机Linux觉得挺好就果断的安装了,下面是安装详情


第一步:下载 安装vnc 这我就不多说了。

第二步:在虚拟机中开启vnc

第三步:在系统中敲 [root@localhost .vnc]# vi  /root/.vnc/xstartup

将文件内容改为如下

#****************************vncserver新配置文件内容**********************
#!/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 &
gnome-session &


第四步:先杀死已运行的服务,vncserver -kill :1然后再重新启动vnc服务 service vncserver restart,再运行vncserver即可,vncserver端口由系统自动分配,运行vncserver可以看到提示
[root@localhost .vnc]# vncserver
New 'localhost.localdomain:6 (root)' desktop is localhost.localdomain:6
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:6.log

第五步:vnc客户端连接时输入IP地址:端口号即可,输入密码后可以操作,如下面启动vncserver分配的端口号是6,root用户

0 0
原创粉丝点击