标签:51cto pid list min release windows7 云平台 multi emctl
目前流行的openstack、zstack等私有云平台主要的支撑技术就是KVM虚拟化技术,应用相当广泛,从两年前就打算折腾虚拟化技术,结果最终一直没折腾起来,目前的公司有1700多台物理机,虚拟机有5000多台,2018年运维部门的目标就是每个人管理的应用或者机器翻一倍,目前的虚拟机多种方式、手动命令创建的老机器,还有用zstack私有云管理的。但是原理和技术支撑都离不开kvm虚拟化。
基础环境:
1、Windows7+vmware workstation11+ CentOS Linux release 7.4 采用嵌套虚拟化
wind7--虚拟化( workstation)—>CentOS7.4-->虚拟化(kvm)其他虚拟机
2、常用工具
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
User=<USER>
ExecStartPre=-/usr/bin/vncserver -kill %i
ExecStart=/usr/bin/vncserver %i
PIDFile=/home/<USER>/.vnc/%H%i.pid
ExecStop=-/usr/bin/vncserver -kill %i
[Install]
WantedBy=multi-user.target
更改后的配置:
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=simple #此方式不更改会报错
#Type=forking
User=root # 服务启动异常
ExecStartPre=-/usr/bin/vncserver -kill %i
#ExecStart=/usr/bin/vncserver %i
ExecStart=/usr/sbin/runuser -l root -c "/usr/bin/vncserver %i"
PIDFile=/root/.vnc/%H%i.pid
#PIDFile=/home/<USER>/.vnc/%H%i.pid
ExecStop=-/usr/bin/vncserver -kill %i
[Install]
WantedBy=multi-user.target
3、设置密码
vncpasswd 12345678
4、加载文件
systemctl daemon-reload
5启动服务和服务开机自启动
systemctl start vncserver@:1.service
systemctl enable vncserver@:1.service
6、检查服务启动状况
[root@localhost ~]# systemctl status vncserver@:1.service
● vncserver@:1.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2018-01-20 13:00:38 CST; 38min ago
Main PID: 1364 (Xvnc)
CGroup: /system.slice/system-vncserver.slice/vncserver@:1.service
? 1364 /usr/bin/Xvnc :1 -auth /root/.Xauthority -desktop localhost.localdomain:1 (root) -fp catalogue:/etc/X11/fon...
Jan 20 13:00:35 localhost.localdomain systemd[1]: Starting Remote desktop service (VNC)...
Jan 20 13:00:38 localhost.localdomain vncserver[1223]: Can‘t find file /root/.vnc/localhost.localdomain:1.pid
Jan 20 13:00:38 localhost.localdomain vncserver[1223]: You‘ll have to kill the Xvnc process manually
Jan 20 13:00:38 localhost.localdomain systemd[1]: Started Remote desktop service (VNC).
检查监听端口
[root@localhost ~]# netstat -nltup |grep 59
tcp 0 0 0.0.0.0:5901 0.0.0.0: LISTEN 1364/Xvnc
tcp 0 0 192.168.122.1:53 0.0.0.0: LISTEN 1510/dnsmasq
tcp 0 0 127.0.0.1:25 0.0.0.0: LISTEN 1335/master
tcp6 0 0 :::5901 ::: LISTEN 1364/Xvnc
tcp6 0 0 ::1:25 ::: LISTEN 1335/master
udp 0 0 192.168.122.1:53 0.0.0.0: 1510/dnsmasq
udp 0 0 0.0.0.0:67 0.0.0.0: 1510/dnsmasq
服务端设置ok
客户端连接:
连接报错
搜资料排查 10061错误没有输入桌面的序号
成功提示输入密码:
连接成功:
标签:51cto pid list min release windows7 云平台 multi emctl
原文地址:http://blog.51cto.com/dreamlinux/2063142