You are on page 1of 17

How to configure Virtual Network Computing (VNC) in Red Hat Enterprise Linux7 and above ? - R... https://access.redhat.

com/solutions/966063

1 de 17 23/10/2020 12:57
How to configure Virtual Network Computing (VNC) in Red Hat Enterprise Linux7 and above ? - R... https://access.redhat.com/solutions/966063

Note:

# yum ‐y install tigervnc‐server tigervnc

# useradd <username>
# passwd <username>

# useradd testuser1
# passwd testuser1

2 de 17 23/10/2020 12:57
How to configure Virtual Network Computing (VNC) in Red Hat Enterprise Linux7 and above ? - R... https://access.redhat.com/solutions/966063

$ vncpasswd

# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service

/etc/systemd/system/vncserver@:1.service

vncserver@:<num>.service

PIDFile /root/.vnc/%H%i.pid

<USER>

“vncserver@:#.service”

ExecStart=

ExecStart=/sbin/runuser ‐l testuser1 ‐c "/usr/bin/vncserver %i ‐geometry 1024x768 ‐depth 24"

~/.vnc/

3 de 17 23/10/2020 12:57
How to configure Virtual Network Computing (VNC) in Red Hat Enterprise Linux7 and above ? - R... https://access.redhat.com/solutions/966063

# firewall‐cmd ‐‐permanent ‐‐zone=public ‐‐add‐port 5901/tcp

# firewall‐cmd ‐‐reload

# systemctl daemon‐reload

# systemctl enable vncserver@:1.service

# systemctl start vncserver@:1.service

/home/username/.vnc/ .vnc/xstartup

4 de 17 23/10/2020 12:57
How to configure Virtual Network Computing (VNC) in Red Hat Enterprise Linux7 and above ? - R... https://access.redhat.com/solutions/966063

# cat ~/.vnc/xstartup

#!/bin/sh
[ ‐x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ ‐r $HOME/.Xresources ] && xrdb $HOME/.Xresources
vncconfig ‐iconic &
dbus‐launch ‐‐exit‐with‐session gnome‐session &

# cat ~/.vnc/xstartup

#!/bin/sh
[ ‐x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ ‐r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#vncconfig ‐iconic &
#dbus‐launch ‐‐exit‐with‐session gnome‐session &
startkde &

vncviewer

# vncviewer vncserver‐ipaddress:N

5 de 17 23/10/2020 12:57
How to configure Virtual Network Computing (VNC) in Red Hat Enterprise Linux7 and above ? - R... https://access.redhat.com/solutions/966063

# vncviewer vncserver‐ipaddress::59XX

# vncviewer vncserver‐ipaddress::5901

6 de 17 23/10/2020 12:57
How to configure Virtual Network Computing (VNC) in Red Hat Enterprise Linux7 and above ? - R... https://access.redhat.com/solutions/966063

7 de 17 23/10/2020 12:57
How to configure Virtual Network Computing (VNC) in Red Hat Enterprise Linux7 and above ? - R... https://access.redhat.com/solutions/966063

8 de 17 23/10/2020 12:57
How to configure Virtual Network Computing (VNC) in Red Hat Enterprise Linux7 and above ? - R... https://access.redhat.com/solutions/966063

9 de 17 23/10/2020 12:57
How to configure Virtual Network Computing (VNC) in Red Hat Enterprise Linux7 and above ? - R... https://access.redhat.com/solutions/966063

cat ~/.vnc/xstartup
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec /etc/X11/xinit/xinitrc

11.3.3. Connecting to VNC Server Using SSH


VNC is a clear text network protocol with no security against possible attacks on the communication. To make
the communication secure, you can encrypt your server‐client connection by using the ‐via option. This will
create an SSH tunnel between the VNC server and the client.

10 de 17 23/10/2020 12:57
How to configure Virtual Network Computing (VNC) in Red Hat Enterprise Linux7 and above ? - R... https://access.redhat.com/solutions/966063

11 de 17 23/10/2020 12:57
How to configure Virtual Network Computing (VNC) in Red Hat Enterprise Linux7 and above ? - R... https://access.redhat.com/solutions/966063

12 de 17 23/10/2020 12:57
How to configure Virtual Network Computing (VNC) in Red Hat Enterprise Linux7 and above ? - R... https://access.redhat.com/solutions/966063

Jul 12 08:12:51 etirhel01.etinet.local pulseaudio[30265]: [pulseaudio] main.c: Failed to initialize daemon.


Jul 12 08:12:52 etirhel01.etinet.local gnome‐shell[29680]: Failed to connect context: Connection refused
Jul 12 08:12:52 etirhel01.etinet.local org.gnome.Shell.desktop[29680]: Window manager warning: "XF86RFKill" is
not a valid acc
elerator
Jul 12 08:12:52 etirhel01.etinet.local gnome‐shell[29680]: Allocating size to ShellEmbeddedWindow 0x19f02b0
without calling gt
k_widget_get_preferred_width/height(). How does the code know the size to allocate?
Jul 12 08:12:53 etirhel01.etinet.local gnome‐shell[29680]: Allocating size to ShellEmbeddedWindow 0x19f02b0
without calling gt
k_widget_get_preferred_width/height(). How does the code know the size to allocate?
Jul 12 08:12:54 etirhel01.etinet.local gnome‐shell[29680]: GNOME Shell started at Thu Jul 12 2018 08:12:44
GMT‐0400 (EDT)
Jul 12 08:12:56 etirhel01.etinet.local pulseaudio[30351]: [pulseaudio] socket‐server.c: bind(): Address already
in use
Jul 12 08:12:56 etirhel01.etinet.local gsd‐media‐keys[29936]: Failed to connect context: Connection refused
Jul 12 08:17:45 etirhel01.etinet.local gnome‐session‐binary[29582]: WARNING: Could not get session path for
session. Check tha
t logind is properly installed and pam_systemd is getting used at login.
Jul 12 08:17:45 etirhel01.etinet.local gnome‐session[29582]: gnome‐session‐binary[29582]: WARNING: Could not
get session path
for session. Check that logind is properly installed and pam_systemd is getting used at login.

13 de 17 23/10/2020 12:57
How to configure Virtual Network Computing (VNC) in Red Hat Enterprise Linux7 and above ? - R... https://access.redhat.com/solutions/966063

# Copy Service templates


cp /usr/lib/systemd/system/xvnc.socket /etc/systemd/system
cp /usr/lib/systemd/system/xvnc@.service /etc/systemd/system/xvnc@0.service

# Enable Service
systemctl enable xvnc.socket
systemctl enable xvnc@0.service

#Edit GDM Custom.conf to enable XDMCP


[XDMCP]
Enable=true
Port=177

#then just poke a hole in the firewall for 5900 tcp (not sure if I also need the localhost one for 177 udp for
xdmcp but I added it anyways)
firewall‐cmd ‐‐permanent ‐‐zone=public ‐‐add‐port 5900/tcp
firewall‐cmd ‐‐permanent ‐‐zone=internal ‐‐add‐port 177/udp

14 de 17 23/10/2020 12:57
How to configure Virtual Network Computing (VNC) in Red Hat Enterprise Linux7 and above ? - R... https://access.redhat.com/solutions/966063

15 de 17 23/10/2020 12:57
How to configure Virtual Network Computing (VNC) in Red Hat Enterprise Linux7 and above ? - R... https://access.redhat.com/solutions/966063

16 de 17 23/10/2020 12:57
How to configure Virtual Network Computing (VNC) in Red Hat Enterprise Linux7 and above ? - R... https://access.redhat.com/solutions/966063

17 de 17 23/10/2020 12:57

You might also like