Skip to main content

TigerVNC for Mageia 9

 

"TigerVNC is a high-performance, platform-neutral implementation of VNC (Virtual Network Computing), a client/server application that allows users to launch and interact with graphical applications on remote machines. TigerVNC provides the levels of performance necessary to run 3D and video applications, and it attempts to maintain a common look and feel and re-use components, where possible, across the various platforms that it supports. TigerVNC also provides extensions for advanced authentication methods and TLS encryption."

Begin by installing both the server and the viewer.

# urpmi tigervnc tigervnc-server

Then read the document at /usr/share/doc/tigervnc/HOWTO.md for specifics on the Mageia installation. That's important because things have changed and the TigerVNC installation recipies foud on the web have not caught up.

The text is shown below:

# What has changed

The previous Tigervnc versions had a wrapper script called `vncserver` which 

could be run as a user manually to start *Xvnc* process. The usage was quite  smple as you just run

```

$ vncserver :x [vncserver options] [Xvnc options]

```

and that was it. While this was working just fine, there were issues when users wanted to start a Tigervnc server using *systemd*. For these reasons things were  completely changed and there is now a new way how this all is supposed to work.


 # How to start Tigervnc server

 

## Add a user mapping

With this you can map a user to a particular port. The mapping should be done in 

`/etc/tigervnc/vncserver.users` configuration file. It should be pretty 

straightforward once you open the file as there are some examples, but basically

the mapping is in form

```

:x=user

```

For example you can have

```

:1=test

:2=vncuser

```


## Configure Xvnc options

To configure Xvnc parameters, you need to go to the same directory where you did

the user mapping and open `vncserver-config-defaults` configuration file. This 

file is for the default Xvnc configuration and will be applied to every user 

unless any of the following applies:

* The user has its own configuration in `$HOME/.vnc/config`

* The same option with different value is configured in 

  `vncserver-config-mandatory` configuration file, which replaces the default 

  configuration and has even a higher priority than the per-user configuration.

  This option is for system administrators when they want to force particular 

  *Xvnc* options.


Format of the configuration file is also quite simple as the configuration is

in form of

```

option=value

option

```

for example

```

session=gnome

securitytypes=vncauth,tlsvnc

desktop=sandbox

geometry=2000x1200

localhost

alwaysshared

```

### Note:

There is one important option you need to set and that option is the session you

want to start. E.g when you want to start GNOME desktop, then you have to use

```

session=gnome

```

which should match the name of a session desktop file from `/usr/share/xsessions`

directory.


## Set VNC password

You need to set a password for each user in order to be able to start the 

Tigervnc server. In order to create a password, you just run

```

$ vncpasswd

```

as the user you will be starting the server for. 

### Note:

If you were using Tigervnc before for your user and you already created a 

password, then you will have to make sure the `$HOME/.vnc` folder created by 

`vncpasswd` will have the correct *SELinux* context. You either can delete this 

folder and recreate it again by creating the password one more time, or 

alternatively you can run

```

$ restorecon -RFv /home/<USER>/.vnc

```


## Start the Tigervnc server

Finally you can start the server using systemd service. To do so just run

```

$ systemctl start vncserver@:x

```

as root or

```

$ sudo systemctl start vncserver@:x

```

as a regular user in case it has permissions to run `sudo`. Don't forget to 

replace the `:x` by the actual number you configured in the user mapping file. 

Following our example by running

```

$ systemctl start vncserver@:1

```

you will start a Tigervnc server for user `test` with a GNOME session.


### Note:

If you were previously using Tigervnc and you were used to start it using 

*systemd* then you will need to remove previous *systemd* configuration files,

those you most likely copied to `/etc/systemd/system/vncserver@.service`, 

otherwise this service file will be preferred over the new one installed with

latest Tigervnc.


# Limitations

You will not be able to start a Tigervnc server for a user who is already

logged into a graphical session. Avoid running the server as the `root` user as

it's not a safe thing to do. While running the server as the `root` should work 

in general, it's not recommended to do so and there might be some things which

are not working properly.



Also, one can read /usr/share/doc/tigervnc-server/HOWTO.md, copied here:


# What has changed

The previous Tigervnc versions had a wrapper script called `vncserver` which 

could be run as a user manually to start *Xvnc* process. The usage was quite 

simple as you just run

```

$ vncserver :x [vncserver options] [Xvnc options]

```

and that was it. While this was working just fine, there were issues when users

wanted to start a Tigervnc server using *systemd*. For these reasons things were 

completely changed and there is now a new way how this all is supposed to work.


 # How to start Tigervnc server

 

## Add a user mapping

With this you can map a user to a particular port. The mapping should be done in 

`/etc/tigervnc/vncserver.users` configuration file. It should be pretty 

straightforward once you open the file as there are some examples, but basically

the mapping is in form

```

:x=user

```

For example you can have

```

:1=test

:2=vncuser

```


## Configure Xvnc options

To configure Xvnc parameters, you need to go to the same directory where you did

the user mapping and open `vncserver-config-defaults` configuration file. This 

file is for the default Xvnc configuration and will be applied to every user 

unless any of the following applies:

* The user has its own configuration in `$HOME/.vnc/config`

* The same option with different value is configured in 

  `vncserver-config-mandatory` configuration file, which replaces the default 

  configuration and has even a higher priority than the per-user configuration.

  This option is for system administrators when they want to force particular 

  *Xvnc* options.


Format of the configuration file is also quite simple as the configuration is

in form of

```

option=value

option

```

for example

```

session=gnome

securitytypes=vncauth,tlsvnc

desktop=sandbox

geometry=2000x1200

localhost

alwaysshared

```

### Note:

There is one important option you need to set and that option is the session you

want to start. E.g when you want to start GNOME desktop, then you have to use

```

session=gnome

```

which should match the name of a session desktop file from `/usr/share/xsessions`

directory.


## Set VNC password

You need to set a password for each user in order to be able to start the 

Tigervnc server. In order to create a password, you just run

```

$ vncpasswd

```

as the user you will be starting the server for. 

### Note:

If you were using Tigervnc before for your user and you already created a 

password, then you will have to make sure the `$HOME/.vnc` folder created by 

`vncpasswd` will have the correct *SELinux* context. You either can delete this 

folder and recreate it again by creating the password one more time, or 

alternatively you can run

```

$ restorecon -RFv /home/<USER>/.vnc

```


## Start the Tigervnc server

Finally you can start the server using systemd service. To do so just run

```

$ systemctl start vncserver@:x

```

as root or

```

$ sudo systemctl start vncserver@:x

```

as a regular user in case it has permissions to run `sudo`. Don't forget to 

replace the `:x` by the actual number you configured in the user mapping file. 

Following our example by running

```

$ systemctl start vncserver@:1

```

you will start a Tigervnc server for user `test` with a GNOME session.


### Note:

If you were previously using Tigervnc and you were used to start it using 

*systemd* then you will need to remove previous *systemd* configuration files,

those you most likely copied to `/etc/systemd/system/vncserver@.service`, 

otherwise this service file will be preferred over the new one installed with

latest Tigervnc.


# Limitations

You will not be able to start a Tigervnc server for a user who is already

logged into a graphical session. Avoid running the server as the `root` user as

it's not a safe thing to do. While running the server as the `root` should work 

in general, it's not recommended to do so and there might be some things which

are not working properly.


We will configure a simple system for user Jack with sudo privileges on the server and user Jack with sudo privileges on the viewer.

On the server, with IP 192.168.1.100,

$ sudo urpmi tigervnc-server

Create a password for Jack.

$ vncpasswd

No need for a "visual password" at this level of simplicity. This creates ~/.vnc with the password file.

The server configuration can be in any of four places according to the tigervnc docs, and we will use ~/.vnc. The session entry is important and must match the style shown in /usr/share/xsessions/, and on the server, this reveals:

01plasma.desktop       icewm.desktop          icewm-session.desktop  LXDE.desktop           openbox.desktop

we will be selecting LXDE.

A display geometry must be chosen. Here, 1280x1024 meets our needs.    

The file ~/.vnc/config needs to be created and using a favorite editor, populated with:

session=LXDE

geometery=1280x1024

securitytypes=vncauth,tlsvnc

localhost

alwaysshared






Having read those and done that, there are also good instructions to be found at Arch Wiki.


Starting TigerVNC Server


To enable the service to launch at system boot using systemctl:

# systemctl enable vncserver@1.service

That number must match the assigned number in /etc/tigervnc/vncserver.users

Check the service status  using systemctl:

# systemctl status vncserver@1.service

On the machine to be used as the viewer, install tiger vnc. and launch it with

$ tigervnc IP-OF-SERVER:#




Comments

Popular posts from this blog

DOS4GW.EXE Version 2.01a and Alternative DOS Extenders

DOS4GW.EXE The Tenberry DOS extender DOS4GW.EXE was used by many early DOS games. I still enjoy playing many of these games and DOS4GW.EXE is usable with DOSBox , so they can be played on Linux. However, the version of DOS4GW.EXE that was included with the game was whatever was current at the time. The most recent version that includes many bugfixes that possibly affected the games when used with DOSBox have been fixed in the latest version, 2.01a. It's not free at US$49, but you can downloaded it here . Simply substitute it for whatever version of DOS4GW.EXE your game provided and enjoy the bug-fixed goodness. Tenberry also makes a "high-performance" "pro" version of DOS4GW.EXE, but it costs $300. I think that they could sell quite a few of these to hobby users (since, you know, DOS is dead) for US$5. Open Souce to the Rescue There are better performing, free and Open Source alternatives available and worth a look. DPMI Explained Let's unders...

Unpack those .EXE game files from GOG.com (Plus other un-packers)

I just came upon innoextract today. I have many of the wonderful games from GOG.com, some of which have native Linux Clients. Before now, I've had to use PlayOnLinux or Crossover to install these for use with WINE, then add the Linux client. InnoSetup as a way to create an installer to install the games on Windows.  Daniel Scharrer has created innoextract to allow the unpacking of those archives on a non-Windows platform. The website provides information on using innoextract , but this information from the page is very useful: GOG.com Installers GOG.com installers with a 2.x.x version number on the download page or in the filename use InnoSetup 5.5.0 and cannot be extracted by innoextract 1.2 and older. Older installers use InnoSetup 5.2.3 and usually have no version in the filename. Some GOG.com multi-part installers with version 2.1.x or higher use RAR archives (renamed to .bin) to store the game data. These files are not part of the InnoSetup installer and require...

Lighttpd and Simple Virtual Hosts Configuration.

I manage some websites for car clubs I belong to. They had been paying for web hosting and had some volunteers who knew not quite enough about maintaining and administrating the sites. Having some prior experience with similar small club sites, I volunteered to host them and admin them. With the first site, the pages were a train wreck of PHP and making even a small change on the existing pages caused the site to crash. Way back around the turn of the last century, I had a few Linux user’s groups that wanted a website, so I worked with Cynthia Manuel of Flamingo Internet Navigators to make a template for a web site that would be easy to maintain and easy to add static content. She developed templates that relied on Server Side Includes (SSI) and Cascading Style Sheets (CSS) to make administration and content additions simple and easy, so I ported all the content over to that template and hosted the site myself. Later, another car club needed the same assistance and I ported it ov...