Vnc server oracle linux

Setting up vnc server on Oracle Linux 8+ on ARM and X86

I’m a huge fan of VNC. It’s a great way to get X access to a server, without having to install X on your PC. VNC aka Virtual Network Computer, also has an advantage that the X session is running on the target machine, which means if the network drops you don’t loose what you are working on. This is huge for anyone on a questionable network that doesn’t want to loose what they are working on.

With later releases of Oracle Linux 8, VNC has changed a bit. It now can run as a service, and also gives you more control over user passwords and what VNC port is assigned to what user.

Install is simple, first start off as root and run these commands. Also, the commands are the SAME on ARM and X86.. at least when you use Oracle Linux. I know I keep saying this, but folks still think ARM is rocket science.. yet it’s all but the same a Oracle Linux that you already know on x86! As a note, selinux is disabled on this system.

First install the VNC sever and related configuration files;

dnf install tigervnc-server -y

Next, you need X on the server, the easiest way is to install a group of RPMs, since I mainly work on severs I usually install the GUI components with the following command;

dnf -y groupinstall 'Server with GUI'

Next, we need to set the system to use a graphical login, and that is done with the following commands;

systemctl set-default graphical.target
systemctl isolate graphical.target

Up next, the firewall. I don’t recommend disabling the firewall, but instead add the VNC ports to the config. VNC uses port 5901 onwards. Session 1 is 5901, session2 5902 etc. For simplicity you can add a range of ports with the following commands;

firewall-cmd --permanent --zone=public --add-port 5901-5910/tcp

The latest version of tigervnc server uses systemctl to start and stop sessions. To do this, you need to copy a blank config to a session ID. In the following example, I setup sessions 1 and 2.

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

One last step as root, we need to assign a user to a session, to do this you need to edit a config file, and put in a line for each session number mapping it to a user. The format is :$NUMBER=$USER

vi /etc/tigervnc/vncserver.users

then add in the line. In this example I map :1 to erik, and :2 to oracle

Читайте также:  Samba включить smb1 linux

Next su – to the user that will be using the session. As the user you will need to set the vnc password with the vncpasswd command.

Next, we will set the session to use gnome with the following command

echo 'session=gnome' > ~/.vnc/config

Personally, I also like more resolution than the default, you can change the default session resolution to 1920×1080 with the following command;

echo ‘geometry=1920x1080’ >> ~/.vnc/config

Now, exit the session, and go back being root.

You can now start the session with the following command;

systemctl start vncserver@:1.service

Next, I like VNC to run as a service, so when the system reboots, the VNC session automatically starts. This being said, the system does take up a few more resources… so if you are tight on RAM/CPU don’t do that.

systemctl enable vncserver@:1.service

As a note, VNC does not encrypt the session, but you can easily forward the ports via ssh.

Now kick off your favorite VNC client; put in the $SERVER:$SESSION in the remote host

Put it the password you set previously

And you now have a nice, reliable, and recoverable X session!

If you have any questions or comments, please us the comment section in the BLOG.

4 Replies to “Setting up vnc server on Oracle Linux 8+ on ARM and X86”

Thanks for the article.
Just a little niggle:
dnf -y groupinstall “Server with GUI”
will copy and paste more reliably if it is single quotes:
dnf -y groupinstall ‘Server with GUI’

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar Widget Area

Social Media

The Oracle VM Book is now available! Click to order!

User Groups

OSSUG NATCAP NATCAP

Recent Posts

Categories

  • Career
  • collaborate
  • Dell
  • Enterprise Manager 12c
  • Enterprise manager 13c
  • Hardware
  • Java
  • networking
  • OOW
  • Oracle Cloud
  • Oracle Database
  • Oracle Database 11G
  • Oracle Database 12c
  • Oracle Database 18c
  • Oracle Database 19c
  • Oracle Database Appliance
  • Oracle Hardware
  • Oracle Linux
  • Oracle Managment Cloud
  • Oracle VM
  • OTN
  • Raspberry PI
  • Security
  • Solaris
  • Uncategorized
  • VirtualBox
  • VMWare
  • ZS3 Storage

Author

Recent Comments

Archives

Meta

Tales from the Datacenter v2.0

Oracle recently released it’s popular Enterprise Database for the Arm CPU. This is news, as it’s the first new architecture announced by Oracle since they added the Itanium architecture. In fact, this also reverses the current path, where Oracle has Continue reading Arming your Database! A comparison of Arm vs X64→ The post Arming your […]

It’s important to note that Java performance can differ across various versions of the software, influenced by several factors. It’s not uncommon for developers and application owners to be caught off guard, as the latest Java version may not necessarily Continue reading What version of Java gives the best performance?→ The post What version of […]

Читайте также:  Security in linux and windows

I’ve done this several times, and decided it was time to write up how it works. Basically, this blog will show you how to install Oracle Linux using the Oracle public yum server! While this is showing how to install Continue reading Installing Oracle Linux from the internet!→ The post Installing Oracle Linux from the […]

Ever wonder how your ISP is really doing, with the quality of their services? Wouldn’t it be fun to be able to track critical metrics, like bandwidth availability and network latency? While we all think about how fast my internet Continue reading Monitoring Internet performance with a Raspberry PI #PiDay2023→ The post Monitoring Internet performance […]

I just wrapped up a webinar this week, and it went well. Once of the folks attending asked about a feature I have beeb really enjoying in 19c. This feature called gradual password rollover allows a database user to have Continue reading The easiest way to change Oracle passwords for app servers … two passwords […]

I was talking with a friend recently, and he was looking for a quick and easy way to virtualize a small lab system. We discussed a full out hypervisor and management system like Oracle Linux Virtualization Manager (OLVM and Oracle’s Continue reading Installing KVM on ARM with Oracle Linux→ The post Installing KVM on ARM […]

I’m a huge fan of VNC. It’s a great way to get X access to a server, without having to install X on your PC. VNC aka Virtual Network Computer, also has an advantage that the X session is running Continue reading Setting up vnc server on Oracle Linux 8+ on ARM and X86→ The […]

I have been talking a bit about ARM these days, with many customers looking at ARM on OCI for the application tier. These customers have already learned that ARM is not that different from x86 when running Oracle Linux. The Continue reading Installing Oracle Linux 9 on ARM→ The post Installing Oracle Linux 9 on […]

While thinking about what to write for the annual Oracle Community Day, I learned that it was being renamed to Joel Kallman Day,in honor of Joe who was the the head of APEX development before his untimely passing. This got Continue reading Oracle and Free, who would have thought? #JoelKallmanDay→ The post Oracle and Free, […]

If you are not familiar with Oracle Linux, this may be the technology included with the distro that makes you pay attention to Oracle’s Free and Open Source Linux distro. Oracle Linux has been around since 2006, and is a Continue reading Oracle Linux Automation Manager- An Introduction and Installation→ The post Oracle Linux Automation […]

Источник

Configuring VNC Server on Linux

The sysvinit method works for RHEL and it’s clones (Oracle Linux and CentOS) up to and including RHEL6. It also works for Fedora up to and including Fedora 15. Although Fedora 15 includes systemd, the VNC server configuration is unchanged, so you should still use this method.

# yum install tigervnc-server

Edit the «/etc/sysconfig/vncservers» file to configure the required displays. The following entries enable VNC for display numbers «:2» and «:3». Notice multiple «display:user» pairs are defined on a single line, but the arguments for each display are defined separately.

VNCSERVERS="2:root 3:oracle" VNCSERVERARGS[2]="-geometry 1280x1024 -nolisten tcp -localhost" VNCSERVERARGS[3]="-geometry 1280x1024"

Set the VNC password for any users defined in the «/etc/sysconfig/vncservers» file.

# vncpasswd Password: Verify: # # su - oracle $ vncpasswd Password: Verify: $ exit logout #

Enable the «vncserver» service for autostart and start the service.

# chkconfig vncserver on # service vncserver start

You should now be able to use a VNC viewer to connect to system using the display numbers and passwords defined.

Читайте также:  Lan messenger linux запуск

Use the following commands to stop the service and disable autostart.

# service vncserver stop # chkconfig vncserver off

systemd (New Method)

The systemd method works for Fedora 16 and above. Although Fedora 15 uses systemd, the VNC server configuration is unchanged so you still use the previous configuration method. This method also works for RHEL7/OL6/CentOS7.

# yum install tigervnc-server

Create a new configuration file for each of the display numbers you want to enable. In the following case, I am setting up the display number «:3». Notice how the display number is included in the configuration file name. In some Fedora releases they suggest not including the display number, as systemd will spawn correct config in memory on first request.

# cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:3.service

Edit the new configuration file, amending the user and startup arguments as necessary. An example of the changed lines is shown below. All other lines should be unmodified. The geometry is set below, but this line doesn’t have to be modified if the default geometry of «1280×1024» is acceptable.

User=oracle ExecStart=/usr/bin/vncserver %i -geometry 1440x1080 PIDFile=/home/oracle/.vnc/%H%i.pid

Run the following command.

Set the VNC password for the user defined in the new configuration file.

# su - oracle $ vncpasswd Password: Verify: Would you like to enter a view-only password (y/n)? n $ exit logout #

Enable the service for autostart and start the service.

# systemctl enable vncserver@:3.service # systemctl start vncserver@:3.service

You should now be able to use a VNC viewer to connect to system using the display number and password defined.

Use the following commands to stop the service and disable autostart.

# systemctl stop vncserver@:3.service # systemctl disable vncserver@:3.service

VNC Clients

Once your VNC server is configured, you can connect to it from any VNC server. On Linux this will often be TigerVNC, installed using the following command.

Connect to a VNC server using the following command.

# vncviewer machine-name:port # vncviewer maggie.localdomain:3 # vncviewer 192.168.0.4:3

Hope this helps. Regards Tim.

Created: 2011-11-15 Updated: 2018-02-19

Источник

Оцените статью
Adblock
detector