If you want to set up a remote desktop environment on Oracle Linux, TigerVNC offers a robust solution. This guide walks you through installing TigerVNC with the GNOME desktop environment, configuring user access, resolving potential policy issues, setting firewall rules, and adjusting screen resolution.
1. Install Required Packages
First, install TigerVNC server and the GNOME desktop environment with dependencies.
dnf install tigervnc-server
dnf group install "Server with GUI"
2. Configure Default Session
By default, TigerVNC may not use GNOME. To ensure GNOME starts, edit the default configuration file:
nano /etc/tigervnc/vncserver-config-defaults
Add or uncomment:
session=gnome
Save the file and exit.
3. Set VNC Password
Switch to the user account that will use VNC (replace vncuser1 with your username):
su - vncuser1
vncpasswd
Enter and confirm a strong password. For security, avoid using the same password as your system login.
4. Configure VNC Users
Edit the VNC users configuration file to assign display numbers to users:
nano /etc/tigervnc/vncserver.users
Add the following line:
:1=vncuser1
Save and exit the file.
5. Start and Enable the VNC Service
Start the VNC server for display :1:
systemctl start vncserver@:1.service
Check its status:
systemctl status vncserver@:1.service
Enable it to start at boot:
systemctl enable vncserver@:1.service
6. Fix PolicyKit Authentication Issue (Optional)
If your VNC session prompts for authentication when refreshing repositories, apply this fix:
- Navigate to the PolicyKit directory: cd /etc/polkit-1/localauthority/50-local.d/
- Edit the configuration: vi 46-allow-update-repo.pkla
- Add the following: [Allow Package Management all Users] Identity=unix-user:* Action=org.freedesktop.packagekit.system-sources-refresh ResultAny=yes ResultInactive=yes ResultActive=yes
- Restart the VNC server: systemctl restart vncserver@:1.service
7. Allow Firewall Access for VNC
Allow VNC traffic through the firewall:
firewall-cmd --permanent --zone=public --add-port=5901/tcp
firewall-cmd --reload
8. Change VNC Resolution
Step 1: Stop VNC Server
systemctl stop vncserver@:1.service
Step 2: Edit Configuration
Edit mandatory configuration to set desired resolution:
nano /etc/tigervnc/vncserver-config-mandatory
Add or modify:
geometry=1920x1080
Step 3: Modify xstartup File
Edit the VNC startup script:
nano ~/.vnc/xstartup
Ensure it contains:
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
xrdb $HOME/.Xresources
xrandr --size 1920x1080
exec /usr/bin/gnome-session &
Step 4: Make xstartup Executable
chmod +x ~/.vnc/xstartup
Step 5: Restart VNC Server
systemctl start vncserver@:1.service
Conclusion
Following these steps will allow you to set up a TigerVNC server with the GNOME desktop environment on Linux efficiently. You will have remote desktop access with customized resolution and firewall access, ensuring both functionality and security.
In addition, addressing potential PolicyKit issues ensures smooth operation without unnecessary prompts. By following this guide, you can set up and maintain a secure, performant VNC server environment tailored to your needs.