Ben Stienstra

Linux, Unix, network, radio and more...

User Tools

Site Tools


centos7_vnc

CentOS 7 - persistent VNC

  • Install tigervnc server.
    yum install tigervnc-server
  • Create new display.
    cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
  • Replace all <USER> placeholders and VNC server parameters (e.g. -geometry 1600×1000) appropriately
    vi /etc/systemd/system/vncserver@:1.service
    
    ExecStart=/sbin/runuser -l <your_username_here> -c "/usr/bin/vncserver %i"
    
    #ExecStart=/sbin/runuser -l <your_username_here> -c "/usr/bin/vncserver %i -geometry 1600x1000 -extension RANDR"
  • Set password with user:
    su - <USER>
    vncpasswd
  • Enable tigervnc server display 1.
    systemctl enable vncserver@:1.service
  • Reload unit files.
    systemctl daemon-reload
  • Start vnc server.
    systemctl start vncserver@:1.service
  • Configure firewalld (example).
    firewall-cmd --get-active-zones
    firewall-cmd --set-default-zone=home
    
    firewall-cmd --set-default-zone=home
    
    firewall-cmd --permanent --zone=home --list-services
    
    firewall-cmd --permanent --zone=home --remove-service=dhcpv6-client
    firewall-cmd --permanent --zone=home --remove-service=ipp-client
    firewall-cmd --permanent --zone=home --remove-service=mdns
    firewall-cmd --permanent --zone=home --remove-service=samba-client
    
    firewall-cmd --permanent --zone=home --add-port=5901/tcp
    firewall-cmd --permanent --zone=home --list-ports
    
    firewall-cmd --reload
centos7_vnc.txt · Last modified: 2016/05/13 15:10 by admin