【笔记】VNC SERVER 搭建 (Centos 6.8 & Centos 7)

从今天开始,开启笔记系列,笔记系列注重于信息记录

 

https://wiki.centos.org/HowTos/VNC-Server

vnc server for centos 6

 

 

install  GNOME Desktop (Optional , vs KDE )

http://www.mustbegeek.com/install-gnome-desktop-on-centos-6/

 

Installation of KDE desktop environment on CentOS 7

源文档 <https://linuxconfig.org/installation-of-kde-desktop-environment-on-centos-7>

 

 

How to Install and Configure VNC Server in CentOS 7

源文档 <https://www.tecmint.com/install-and-configure-vnc-server-in-centos-7/>

 

 

troubeshooting

1.遇到以下问题 Failed to set a watch for vncserver@:1.service's PID file /root/.vnc/localhost.localdomain:1.pid: Too many open files

查看配置发现无误,切换到 /root/.vnc 查看文件如下,发现没有 localhost.localdomain.1.pid 和 localhost.localdomain.1.log ,那么权限问题,重启可以解决

config                        localhost.localdomain:10.pid  localhost.localdomain:11.pid  localhost.localdomain:12.pid  xstartup

localhost.localdomain:10.log  localhost.localdomain:11.log  localhost.localdomain:12.log  passwd

 

 

[root@localhost system]# pwd

/etc/systemd/system

 

[root@localhost system]# cat vncserver@\:1.service

# The vncserver service unit file

#

# Quick HowTo:【这里是配置说明】

# 1. Copy this file to /etc/systemd/system/vncserver@.service

# 2. Replace <USER> with the actual user name and edit vncserver

#    parameters appropriately

#    (ExecStart=/usr/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"

#     PIDFile=/home/<USER>/.vnc/%H%i.pid)

# 3. Run `systemctl daemon-reload`

# 4. Run `systemctl enable vncserver@:<display>.service`

#

# DO NOT RUN THIS SERVICE if your local area network is

# untrusted!  For a secure way of using VNC, you should

# limit connections to the local host and then tunnel from

# the machine you want to view VNC on (host A) to the machine

# whose VNC output you want to view (host B)

#

# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB 【端口号590N

#

# this will open a connection on port 590N of your hostA to hostB's port 590M

# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).

# See the ssh man page for details on port forwarding)

#

# You can then point a VNC client on hostA at vncdisplay N of localhost and with

# the help of ssh, you end up seeing what hostB makes available on port 590M

#

# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.

#

# Use "-localhost" to prevent remote VNC clients connecting except when

# doing so through a secure tunnel.  See the "-via" option in the

# `man vncviewer' manual page.

 

 

[Unit]

Description=Remote desktop service (VNC)

After=syslog.target network.target

 

[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=/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 || :'

 

[Install]

WantedBy=multi-user.target

 

 

 

Switch from KDE to GNOME or viceversa in Red Hat Enterprise Linux 7

源文档 <https://www.linuxsecrets.com/429-switch-from-kde-to-gnome-or-viceversa-in-red-hat-enterprise-linux-7>

 

 

remove GNOME

源文档 <https://ask.fedoraproject.org/en/question/27724/remove-gnome/>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值