1.安装vnc server
[root@pxe ~]# yum install tigervnc-server -y
2.设置 vnc server 开机启动
[root@pxe ~]# chkconfig vncserver on
3.修改vncserver 配置文件
[root@pxe ~]# vi /etc/sysconfig/vncservers
在配置文件后添加以下内容
VNCSERVERS="2:root"
VNCSERVERARGS[2]="-geometry 1366x768 -nolisten tcp"
设置vncserver 的密码
[root@pxe ~]# vncpasswd
Password:
Verify:
4.启动sncserver 服务
[root@pxe ~]# /etc/init.d/vncserver start
5.使用VNC Viewer 远程连接
图片54.png
CentOS7配置VNC
一.安装
以root用户运行以下命令来安装vncserver;
yum install tigervnc-server
同样运行以下命令来安装vncviewer;
yum install vnc
停止并禁用防火墙;
systemctl stop firewalld.service
systemctl disable firewalld.service
二.配置
vncviewer基本上不用配置;
vncserver的配置,创建一个新的配置文件,以开启1号窗口为例(也可以同时开启多个窗口,修改数字即可),方法如下:
cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:1.service
或者再增加一个窗口:
cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:2.service
编辑/lib/systemd/system/vncserver@:1.service,设置用户root相关参数
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i -geometry 800x600"
PIDFile=/root/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
三.应用
更新systemctl以使其生效;
systemctl daemon-reload
设置vncserver的密码;
vncpasswd root
按提示输入密码以及确认密码
启动该服务用来启用vnc的1号窗口;
systemctl start vncserver@:1.service 或者 vncserver :1
关闭1号窗口:
systemctl stop vncserver@:1.service 或者 vncserver -kill :1
设置为开机自动启动;
systemctl enable vncserver@:1.service
至此,Linux下VNC Server安装配置完成。
来源:景安
seozixuewang
手机扫码阅读
专业的技术驱动型网络技术公司,公司成立于2009年,12年专注数字产品开发,用创新迎合客户不断增长的需求,为客户提供专业的数字化解决方案, 为企业和品牌在不断变化的数字化环境中脱颖而出。
威海网站建设, 威海微信公众号开发, 威海企业邮箱, 威海行业网站, 威海系统开发, 威海软件开发, 威海APP开发, 威海域名注册, 威海商标查询, 威海商标注册, 威海商标设计, 威海知识产权代理, 威海房产销控系统, 威海缺陷跟踪系统, 威海企业云/私有云解决方案, 威海企业邮局