【大数据毕设环境配置四】-在centos7里面安装并且配置VNC

安装说明

	# 在master里面进行安装
	# 在root情况下运行
	yum groupinstall -y "X Window System"
	yum groupinstall -y "GNOME Desktop" "Graphical Administration Tools"
	yum update grub2-common
	ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
	reboot
	yum -y install tigervnc-server
	cp /lib/systemd/system/[email protected] /etc/systemd/system/vncserver@:1.service
	vim /etc/systemd/system/vncserver@:1.service
	# Clean any existing files in /tmp/.X11-unix environment
	ExecStartPre=/bin/sh -c "/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :"
	ExecStart=/usr/sbin/runuser -l root -c "/usr/bin/vncserver %i"
	PIDFile=/root/.vnc/%H%i.pid
	ExecStop=/bin/sh -c "/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :"
	systemctl daemon-reload
	systemctl enable vncserver@:1.service
	vncpasswd#设定密码
	#然后云端开放5901端口
	systemctl start vncserver@:1.service

下载本地VNC

  • https://www.realvnc.com/en/connect/download/viewer/linux/ (下载)
  • sudo ./VNC-Viewer-6.20.113-Linux-x64 (运行)

报错
VNC Timed out waiting for a response from the computer
解决办法
yum install iptables-services
sudo /sbin/iptables -I INPUT 1 -p TCP --dport 5901:5910 -j ACCEPT
service iptables restart
参考

  • https://www.yht7.com/news/24704
  • https://blog.csdn.net/testcs_dn/article/details/88369085

你可能感兴趣的:(大数据学习,环境相关)