4a81f2
# What has changed
4a81f2
The previous Tigervnc versions had a wrapper script called `vncserver` which 
4a81f2
could be run as a user manually to start *Xvnc* process. The usage was quite 
4a81f2
simple as you just run
4a81f2
```
4a81f2
$ vncserver :x [vncserver options] [Xvnc options]
4a81f2
```
4a81f2
and that was it. While this was working just fine, there were issues when users
4a81f2
wanted to start a Tigervnc server using *systemd*. For these reasons things were 
4a81f2
completely changed and there is now a new way how this all is supposed to work.
4a81f2
4a81f2
 # How to start Tigervnc server
4a81f2
 
4a81f2
## Add a user mapping
4a81f2
With this you can map a user to a particular port. The mapping should be done in 
4a81f2
`/etc/tigervnc/vncserver.users` configuration file. It should be pretty 
4a81f2
straightforward once you open the file as there are some examples, but basically
4a81f2
the mapping is in form
4a81f2
```
4a81f2
:x=user
4a81f2
```
4a81f2
For example you can have
4a81f2
```
4a81f2
:1=test
4a81f2
:2=vncuser
4a81f2
```
4a81f2
4a81f2
## Configure Xvnc options
4a81f2
To configure Xvnc parameters, you need to go to the same directory where you did
4a81f2
the user mapping and open `vncserver-config-defaults` configuration file. This 
4a81f2
file is for the default Xvnc configuration and will be applied to every user 
4a81f2
unless any of the following applies:
4a81f2
* The user has its own configuration in `$HOME/.vnc/config`
4a81f2
* The same option with different value is configured in 
4a81f2
  `vncserver-config-mandatory` configuration file, which replaces the default 
4a81f2
  configuration and has even a higher priority than the per-user configuration.
4a81f2
  This option is for system administrators when they want to force particular 
4a81f2
  *Xvnc* options.
4a81f2
4a81f2
Format of the configuration file is also quite simple as the configuration is
4a81f2
in form of
4a81f2
```
4a81f2
option=value
4a81f2
option
4a81f2
```
4a81f2
for example
4a81f2
```
4a81f2
session=gnome
4a81f2
securitytypes=vncauth,tlsvnc
4a81f2
desktop=sandbox
4a81f2
geometry=2000x1200
4a81f2
localhost
4a81f2
alwaysshared
4a81f2
```
4a81f2
### Note:
4a81f2
There is one important option you need to set and that option is the session you
4a81f2
want to start. E.g when you want to start GNOME desktop, then you have to use
4a81f2
```
4a81f2
session=gnome
4a81f2
```
4a81f2
which should match the name of a session desktop file from `/usr/share/xsessions`
4a81f2
directory.
4a81f2
4a81f2
## Set VNC password
4a81f2
You need to set a password for each user in order to be able to start the 
4a81f2
Tigervnc server. In order to create a password, you just run
4a81f2
```
4a81f2
$ vncpasswd
4a81f2
```
4a81f2
as the user you will be starting the server for. 
4a81f2
### Note:
4a81f2
If you were using Tigervnc before for your user and you already created a 
4a81f2
password, then you will have to make sure the `$HOME/.vnc` folder created by 
4a81f2
`vncpasswd` will have the correct *SELinux* context. You either can delete this 
4a81f2
folder and recreate it again by creating the password one more time, or 
4a81f2
alternatively you can run
4a81f2
```
4a81f2
$ restorecon -RFv /home/<USER>/.vnc
4a81f2
```
4a81f2
4a81f2
## Start the Tigervnc server
4a81f2
Finally you can start the server using systemd service. To do so just run
4a81f2
```
4a81f2
$ systemctl start vncserver@:x
4a81f2
```
4a81f2
as root or
4a81f2
```
4a81f2
$ sudo systemctl start vncserver@:x
4a81f2
```
4a81f2
as a regular user in case it has permissions to run `sudo`. Don't forget to 
4a81f2
replace the `:x` by the actual number you configured in the user mapping file. 
4a81f2
Following our example by running
4a81f2
```
4a81f2
$ systemctl start vncserver@:1
4a81f2
```
4a81f2
you will start a Tigervnc server for user `test` with a GNOME session.
4a81f2
4a81f2
### Note:
4a81f2
If you were previously using Tigervnc and you were used to start it using 
4a81f2
*systemd* then you will need to remove previous *systemd* configuration files,
4a81f2
those you most likely copied to `/etc/systemd/system/vncserver@.service`, 
4a81f2
otherwise this service file will be preferred over the new one installed with
4a81f2
latest Tigervnc.
4a81f2
2a5d62
If you want to use a remote NFS server for the home directories on this machine,
2a5d62
you must set the use_nfs_home_dirs boolean:
2a5d62
```
2a5d62
setsebool -P use_nfs_home_dirs on
2a5d62
```
2a5d62
4a81f2
# Limitations
4a81f2
You will not be able to start a Tigervnc server for a user who is already
4a81f2
logged into a graphical session. Avoid running the server as the `root` user as
4a81f2
it's not a safe thing to do. While running the server as the `root` should work 
4a81f2
in general, it's not recommended to do so and there might be some things which
4a81f2
are not working properly.