Vncserver

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 39

--------------------------------------------------------------------------------

How to Set Up VNC from Windows to Fedora 14 Over the Internet


--------------------------------------------------------------------------------

Nov27 2010 25 Comments Written by Steve Jenkins

Installing the VNC server in Fedora 14 is a little bit different than I described
it for Fedora 12, so here are some updated instructions for setting up VNC in
Fedora 14 and connecting to it via Windows over the Internet.

Step 1: Make sure SSH is Running


--------------------------------

In all versions prior to Fedora 14, SSH is turned on by default.


However, this is no longer the case with Fedora 14.

Before being able to connect to your Fedora 14 box over a network, you must have
physical access to the machine and explicitly enable SSH from the console.

To do this, log in as root and do:

service sshd start


chkconfig sshd on

You should also make sure that your firewall settings (if any) allow remote access
to port 22 (the default SSH port). I’ve also written a separate blog post on steps
you can take to secure SSH on your server.

Step 2: Install TigerVNC Server on the Remote Fedora 14 Box


------------------------------------------------------------

The TigerVNC server package may have been installed by default on your Fedora 14
box when you installed the OS, but to make sure, become root (or sudo) and type:

dnf install tigervnc-server

If it’s already installed, Fedora will let you know. If it’s not, it will be now!

Step 3: Configure Screen Resolutions, Port Number, and Users on the Remote Fedora
14 Box
----------------------------------------------------------------------------

The /etc/sysconfig/vncservers file controls which users are allowed to access


your Fedora box via VNC, as well as what ports they will connect to, and what
screen resolutions each of those users will use when connecting.

As root, open the /etc/sysconfig/vncservers file with your favorite text editor
and find the lines at the bottom that look something like this:

# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"

Uncomment those lines, then change “myusername” to your Linux username on the
first line. On the second line, change the geometry to whatever screen resolution
you’d like for your desktop when remotely connecting (to avoid seeing scroll bars,
make sure it’s smaller than the size of your local desktop), and then, for right
now,
remove the default -localhost option.
We’ll test your VNC connection without it first, and then add that option back
later when we’re sure VNC is working.

Assuming your Linux username was clyde, those lines should now read:

VNCSERVERS="2:clyde"
VNCSERVERARGS[2]="-geometry 1024x768 -nolisten tcp"

This tells the VNC server to set up VNC display port #2


(the default for remote access) to for clyde to connect with a screen resolution
of 800×600.

Step 4: Configure the VNC Desktop Environment and Password


----------------------------------------------------------

For the next step, you should be logged in to your Fedora box as the user whose
desktop you’ll want to access.

If you’re already logged in as root, and your username is clyde, type:


su - clyde

The hyphen is important, as it will load the local path for clyde,
which we’ll need for the next step. Now type:

vncserver

This will run the vncserver program, and will set up default versions of the
necessary desktop environment files for whichever user ran the program
(in this case, clyde).

The first time you run vncserver, it will look like this:

You will require a password to access your desktops.

Password:
Verify:
xauth: creating new authority file /home/stevej/.Xauthority

New 'server.hostname:1 (clyde)' desktop is server.hostname:1

Creating default startup script /home/clyde/.vnc/xstartup


Starting applications specified in /home/clyde/.vnc/xstartup
Log file is /home/clyde/.vnc/server.hostname:1.log

When it prompts you for a password, this will be your VNC password, which you’ll
use to connect to your remote desktop. If you choose, this can be different than
your Linux account password.

If you ever want to change your VNC password, just type vncpasswd while logged
on as the user whose password you want to change.

The newly created files will be in the .vnc directory under the user’s home
directory (for our example, /home/clyde/.vnc).

Using your favorite text editor, edit the /home/username/.vnc/xstartup file.

Go to the bottom of the file, comment out the twm & line, and then add a line
that tells VNC to start your desktop of choice.
If you want a GNOME desktop, the last two lines should read:

# twm &
startx &

If you prefer a KDE desktop, they should read:

# twm &
startkde &

Step 5: Start the VNC Server Service


--------------------------------

To start and stop services, you’ll need to be logged in as root.


If you’re still logged in as a different user, type exit to get back to the root
user. Make sure any previous instance of vncserver service is stopped by typing:

service vncserver stop

If you get a FAILED message in reply, it’s OK. That just means that the server
wasn’t running.

Now, start the service with all the settings you’ve entered with:

service vncserver start

You should get a success message that says something like:

Starting VNC server: 2:clyde


New 'server.hostname:2 (clyde)' desktop is server.hostname:2

Starting applications specified in /home/clyde/.vnc/xstartup


Log file is /home/clyde/.vnc/server.hostname:2.log

If you get a FAILED message, double-check the previous steps.


Check for typos in the /etc/sysconfig/vncservers file, such as username, and
make sure that you don’t have any spaces in the screen resolution parameter.

Step 6: Allow sshd to Forward Ports (SELinux users only)


--------------------------------------------------------

Check to see if you have SELinux enabled on your system with:

# sestatus

If you get a reply that says it’s disabled, you can skip to the next step.

If it is enabled, then you need to allow the sshd daemon to forward ports
– otherwise, you’ll only be able to connect over the local network.

Tell SELinux that sshd can forward ports with:

# setsebool -P sshd_forward_ports 1

Step 7: Configure Firewall Settings


-----------------------------------

If you have the Linux Firewall turned off on your Fedora 14 box, you can skip this
step.

If you’re using the built-in firewall on your Fedora 14 box, you’ll need to tell
it to allow incoming connections on the port you set up in Step 2 above.

The number(s) you used in the VNCSERVERS= line(s) of the /etc/sysconfig/vncservers


file determine which port numbers VNC will listen on.

Our example used VNCSERVERS=”2:clyde”, which means you’d need to open


port 5902 in your firewall.

If you set up other users and/or other ports, then you’ll need to open those as
well: 1=port 5901, 2= port 5902, 3=port 5903, etc.

To add the appropriate port(s) to your firewall,


edit the /etc/sysconfig/iptables file and add the following line:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT

If you’re using additional ports for VNC, add a separate line for each.

The following line should already appear somewhere in your /etc/sysconfig/iptables


file, but if it isn’t there for some reason, now is a good time to add it so you
can connect to your VNC server securely in a later step:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

Once you’ve added the appropriate line(s), restart your firewall with:

service iptables restart

Step 8: Configure Router Port Forwarding


----------------------------------------

If your network lives behind a router (and most home-based broadband users’
networks do), and you only want to access your Fedora 14 desktop from inside the
same local network, then you don’t need to mess with port forwarding on your router
and can skip to the next step.

If the only way you plan on connecting to your Fedora 14 desktop over the Internet
is via a secure SSH tunnel (which is what I recommend), then you’ll need to verify
that you’ve properly forwarded port 22 (the default SSH port) on your router to the
internal IP address of your Fedora 14 box.

If you’re able to SSH into your Fedora 14 box from outside your router, then you’ve
already got things forwarded properly. Check your router’s instructions
(or the instructions for your router’s firmware if you’re using something
like DD-WRT or Tomato) on how to set up port forwarding.

If you would like to connect to your Fedora 14 desktop over the Internet without
a secure SSH tunnel (and I would recommend doing this only for testing and
troubleshooting purposes and only when first getting things set up), then you’ll
need to forward the appropriate VNC port(s) from your router to your Fedora 14 box
(we used port 5902 in our example).

Again, this is recomended only for testing purposes, as it is not a secure


connection.

Step 9: Install a VNC Client on Windows


----------------------------------------

Because it’s lightweight, stable, supports the secure connection we’ll be setting
up in a minute, and completely FREE, I recommend TightVNC client, which can be
downloaded here. But there are many other good VNC clients available out there,
including RealVNC, and an interesting one called Terminals, which allows you to
set up multiple tabs in one application with both Windows RDC and Linux VNC
connections, kind of like tabs in your Web browser.

So download and install the VNC client of your choice.

Step 10: Connect to your VNC Server


-----------------------------------

Open your VNC client and connect to the appropriate IP address of your Fedora 14
box and the port that you chose in /etc/sysconfig/vncservers.

If you’re connecting from inside your network and the IP address of your Fedora 14
box is 192.168.1.100, then to connect to port #2 as in our example, you’d connect
to 192.168.1.100:5902.

If you’re connecting from outside your nework and want to connect to port #2 as
in our example, then use your WAN IP and VNC port instead, as in
222.33.444.55:5902.

You’ll be prompted for the VNC password you set up in an earlier step, and the
desktop you configured in /home/username/.vnc/xstartup should display.

If you are unable to connect, go back and carefully re-check each step.
It’s probably a very simple typo or a small thing you forgot.

Step 11: Connect to your VNC Server with SSH Tunnelling


-------------------------------------------------------

Now that you know your VNC server is running properly, it’s time to secure things.

This isn’t necessary when connecting to your Fedora 14 box via VNC inside a
trusted network. But if you want to connect over the Internet, you really should
take this extra step, which will only take a couple of minutes to configure.

First, you’ll need a Windows SSH client. I use SecureCRT (which is a commercial
app with a free trial period), but you can also do it easily with a very popular
freeware Windows SSH client called PUTTY.

The idea behind SSH tunneling is to establish a secure SSH connection between your
Windows box and the remote Fedora 14 box, and then “tunnel” the VNC connection
through your SSH connection.

Don’t worry… it’s much easier than it sounds.

In SecureCRT: create a new connection to the IP address or hostname of your


remote Fedora 14 box (or the external IP address of the router if you’re
connecting from outside the local network).

Under the Connection category, set the protocol to SSH2.

In the SSH2 sub-category, use port 22, and be sure to use the username on the
Fedora 14 box that you configured in /etc/sysconfig/vncservers
(in our example, it was clyde).
In the Port Fowarding sub-category, hit Add…, enter a descriptive name for the
forwarded connection (such as VNC), then put the port number that corresponds
to the number you set up in /etc/sysconfig/vncservers for that username in both
port fields (in our example, both would be 5902).

None of the checkboxes need to be selected.

Save your new connection, then click Connect. A terminal window should appear,
and you’ll be prompted for your username and password.

Use your Fedora account username and password


(which may be different than the VNC password you set up).

--------------------------------------------------------------------------------
VNC SERVER
--------------------------------------------------------------------------------

-----------------------------------------------------------------------------------
--------------------
Configurare VNC Server
-----------------------------------------------------------------------------------
--------------------

Il VNC (Virtual Network Computing) è un software che rende possibile vedere ed


interagire con
altri computer. Questo è possibile attraverso una rete, connettendo il programma
client al server.

VNC è cross platform quindi il server ed il client possono essere su qualsiasi


tipo di sistema operativo.

Può essere usato come system administrator o per semplice visualizzazione e


controllo di computer sulla rete.

ATTENZIONE! Il protocollo di VNC è insicuro.


Per attivare una connessione assicuratevi di avere un buon
firewall. In alternativa utilizzate ssh.

Non utilizzate VNC per connettervi all'account root!

Vediamo come utilizzare VNC in Fedora.

Configurazione Server
-----------------

Assicuratevi di averlo installato, vnc-server si trova nel cd 1


di installazione, vediamo i valori di configurazione:

nel file /usr/bin/vncserver ci sono 2 valori da personalizzare:

# la modalità di visualizzazione, scegliete la dimensione che


volete: 800x600 etc
$geometry = "1024x768";

# la profondita colore che può essere 8, 15, 16, 24


$depth = 16;

Ovviamente queste impostazioni dipendono dal monitor che usate e dalla velocità
di connessione,
se avete server e client sulla stessa rete locale, settate al massimo per una
migliore visualizzazione.

Per visualizzare interamente la finestra del VNC, impostate una risoluzione


inferiore al vostro
monitor es: se ho il monitor a 1024x768, setterò 800x600 e così via.

Configurazione Account
------------------

Prima di avviare il server dobbiamo creare gli account locali


per ogni utente a cui vogliamo accedere sul server.

Per farlo, come utente, e per ogni utente:

richiede la password che servirà per connettersi a questo account

$ vncserver

You will require a password to access your desktops.

Password:
Verify:

New 'NOME_MACCHINA:1 (NOME_UTENTE)' desktop is NOME_MACCHINA:1

Creating default startup script /home/NOME_UTENTE/.vnc/xstartup


Starting applications specified in /home/NOME_UTENTE/.vnc/xstartup
Log file is /home/NOME_UTENTE/.vnc/NOME_MACCHINA:1.log
$

Bene, adesso per visualizzare in modalità grafica, dobbiamo aprire il file


/home/NOME_UTENTE/.vnc/xstartup,

decommentando le due line:

#!/bin/sh

# Uncomment the following two lines for normal desktop:

unset SESSION_MANAGER #QUESTA


exec /etc/X11/xinit/xinitrc #E QUESTA
# NON MODIFICARE SOTTO
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

Avviare il server
-------------------

Ci siamo il server è configurato. Non ci resta che avviarlo:

# /sbin/service vncserver start


Avvio di server VNC : 1:NOME_UTENTE [ OK ]
Adesso ci possiamo connettere da un'altra macchina.

Connettersi
------------

Per connetterci al server, useremo un client, che può essere


vncviewer, che si installa con il pacchetto che si trova nel cd
3 di Fedora, oppure possiamo utilizzare krdc, di KDE.
Qualunque utilizziamo, non dobbiamo fare altro che inserire
l'IP della macchina e il display:

$ vncviewer &

Poi mi verrà chiesta la password.


Quando saremo connessi, con F8 possiamo accedere al menu.

In questo esempio ho avviato il server sul mio portatile, che


usa XFce, ed ho aperto il mio account con KDE, giusto per
farvi vedere la differenza:

Gestione
--------

Nel caso che avessimo più utenti sullo stesso server, quando
daremo il comando vncserver come utente, verrà creato
un pid con numero progressivo.
(es. NOME_MACCHINA:1.pid, NOME_MACCHINA:2.pid), questi
devono essere utilizzati per la connessione, per connettersi
al rispettivo account utente.

Per arrestare il pid utente posso usare il comando:

$ vncserver -kill :NUMERO_UTENTE

Questo annullerà il pid, di conseguenza se voglio riutilizzare questo account nel


VNC dovrò ricrearlo.

Se vogliamo dichiarare i vari pid di default, dobbiamo inserirli in


/etc/sysconfig/vncserver, modificando il valore VNCSERVERS:

VNCSERVERS = "1:NOME_UTENTE"

# per più utenti


VNCSERVERS = "1:NOME_UTENTE 2:NOME_UTENTE 3:NOME_UTENTE"

Maggiori informazioni: http://www.realvnc.com/

$ man vncserver

$ man vncviewer
0 Comment(s) View this article in PDF format Print article Send article

--------------------------------------------------------------------------------
VNCSERVER:Your server doesn't start.
--------------------------------------------------------------------------------
If you do /etc/init.d/vncserver restart, does it start?
"unable to connect to host: connection refused (10061)"

> >> vncserver config file.


All I want to be able to access it is root. it always gives me an unable to
connect to host: connection refused (10061)
Edit /etc/sysconfig/vncserver to match your options.
(Which users, what resolution, etc.

Then:
chkconfig --level 345 vncserver on
# The VNCSERVERS variable is a list
of display:user pairs.

Make sure you have the following lines in your vncservers


VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1024x768"
Then, run vncpasswd as root,
it'll ask you for a password.

-----------------------------------------------------------------------------------
-------------------------------------------------------------

"Virtual Network Computing (VNC) is a desktop protocol to remotely control another


computer.
It transmits the keyboard presses and mouse clicks from one computer to another
relaying the
screen updates back in the other direction, over a network."

This article describes in brief how to configure VNC server instances for one or
multiple users
on a remote machine, how to use VNC to start graphical applications on boot and
finally how
to enhance security by connecting to the server through encrypted SSH tunnels.

Prerequisites
--------------------

A user account should exist on the remote machine.


The RPM packages vnc-server and vnc should be installed on
the remote machine and your workstation respectively.

Setting up the server


-----------------------------

I assume that we have setup a remote user account, named


"leopard" and we want to start an X session through VNC for
this user.

In Fedora Core or Red Hat based distros in general, all we


have to do is define the VNC server instances in
/etc/sysconfig/vncservers.

These will be started by the vncserver initscript.


This has to be done as root.

Edit this file so that it contains the following:

VNCSERVERS="3:leopard"
VNCSERVERARGS[3]="-geometry 1024x768 -depth 16"

With these we define that a vnc server instance should be


started as user leopard on display 3 and we also set some
options for this server such as resolution and color depth.

Each VNC server instance listens on port 5900 plus the


display number on which the server runs.

In our case, leopard’s vnc server would listen on port 5903.

For multiple vnc instances /etc/sysconfig/vncservers would


look like this:

VNCSERVERS="1:tiger 2:albatros 3:leopard"


VNCSERVERARGS[1]="-geometry 1024x768 -depth 16"
VNCSERVERARGS[2]="-geometry 800x600 -depth 8"
VNCSERVERARGS[3]="-geometry 1024x768 -depth 16"

These would listen on ports 5901, 5902, 5903 respectively.

User Configuration
------------------------

There is one more thing that needs to be done on the remote


machine. User leopard’s vnc password needs to be set.
So, as user leopard give the command:

# vncpasswd

We are prompted for a password. This is the password that we will use when we
connect to leopard’s vnc server instance. This password is saved in
/home/leopard/.vnc/passwd.

Start the VNC server


--------------------

After the initial configuration is done we restart the vnc service. As root:

# service vncserver restart

To make VNC server to start on boot:

# chkconfig vncserver on

More User Configuration


-----------------------

After the VNC service is started, some new files are created in
/home/leopard/.vnc/ directory. These include leopard’s vnc server log file, pid
file and an X startup script. As user leopard we edit the script in order to
customize some settings.

The default /home/leopard/.vnc/xstartup script contains some commands that are


executed when the VNC server is started. These include:

xsetroot -solid grey


vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

- xsetroot in this case sets the background color.


- vncconfig is a supplementary program that can be used to control the vnc server.
Apart from this, when run without arguments it acts as a helper application and
its main purpose is to provide support for clipboard transfers between the client
(vncviewer) and the vnc server.

- xterm starts an xterm terminal.

- twm starts the X server’s default window manager. We probably want to change that
to a more user friendly window manager, eg fluxbox.

The VNC server, apart from letting us control a remote machine using a graphical
interface, it serves as a way to start graphical applications on boot.

For example, I want my favourite p2p program, amule, to start on boot. So, I add
this to the /home/leopard/.vnc/xstartup script.

This is how my xstartup file looks like:

xsetroot -solid grey


vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" -e ./menu &
amule &
fluxbox &

menu is a script of mine that is executed when xterm is started.

Remember to put the "&" symbol after each command, so that it goes to the
background and the xstartup script continues on.

Restart the VNC service for the changes to take effect. As root:

# service vncserver restart

Connect to the VNC server


--------------------------

In our example, leopard’s vnc server listens for connections on port 5903.
So, open this port in the remote machine’s firewall.

We connect to the remote machine using a vnc viewer. Having installed the vnc
package, connect to to the server with the following command:

# vncviewer 192.168.0.1:5903:3

The general usage is :

vncviewer [Server's IP]:[Port]:[Display]

We are prompted for the password and eventually connect to the server.
Closing the vncviewer’s window, does not affect the server or the programs we run
on it. If we reconnect everything will be there.

Special Note: There is no need, actually it’s pointless and could give you some
trouble, to logoff from your remote X session. If this happens, generally you
need to restart the VNC service on the remote machine to get your remote desktop
back. If you want to stop working on your remote desktop, just close the
vncviewer’s
window and you are done.
Security
--------

The VNC protocol is not a secure communication protocol. The use of a vnc password
provides security at the level of server access (it’s vulnerable to brute-force
attacks though), but the whole VNC session is transmitted in the clear, without
encryption. The easiest, but most effective, way to secure our connection to the
VNC server is to connect through an encrypted SSH tunnel. This way the whole
session will be encrypted.

The rest assume that you have the SSH server up and running on your remote
machine (server.example.com) and you know what SSH tunnels are.

So, what we are going to do is to create an encrypted tunnel, and connect to our
VNC server through it. We also want this tunnel to be automatically closed as
soon as we shut down vncviewer. All this is done with the following command:

# ssh -f
-L 25903:127.0.0.1:5903
[email protected]
sleep 10;
vncviewer 127.0.0.1:25903:3

This is what it does:

* -L 25903:127.0.0.1:5903 forwards our local port 25903 to port 5903 on the


remote machine. In other words, it creates the tunnel.

* -f forks the SSH session to the background, while sleep is being executed on
the remote machine. This ssh option is needed because we want to execute the
following command (vncviewer) in the same local machine’s terminal.

* vncviewer connects to the forwarded local port 25903 in order to connect to the
VNC server through the encrypted tunnel.

The sleep command is of major importance in the above line as it keeps the
encrypted tunnel open for
10 seconds. If no application uses it during this period of time, then it’s closed.
Contrariwise, if an
application uses it during the 10 sec period, then the tunnel remains open until
this application is shut down.
This way the tunnel is automatically closed at the time we close vncviewer’s
window, without leaving any SSH
processes running on our workstation.

This is pure convenience!


More information can be found at the Auto-closing SSH Tunnels article.

Using SSH tunnels to conect to your VNC server has two advantages:
---------------------------------------------------------

1. The whole session is encrypted.


2. Keeping port 5903 open on your remote machine is no longer needed, since all
take place through
the SSH tunnel. So, noone will know that you run a VNC server on the remote
machine.

Further Reading
-------------

I recommend that you read the man pages. Everything is in there:

# man vncserver
# man Xvnc
# man vncconfig
# man vncviewer
# man ssh

-----------------------------------------------------------------------------------
--------------------
HOWTO: Come configurare VNC in modo che non risulti su di un display
separato ma sia sul display nativo, ovvero 0
-----------------------------------------------------------------------------------
--------------------

ovvero: come fare in modo che il normale desktop di GNU/Linux sia condiviso tra
due utenti, uno seduto di fronte al PC ed uno in remoto tramite VNC).

Ottima soluzione per poter vedere cosa combina il vostro amico neofita e
soprattuto per poter fargli vedere in diretta cosa deve fare...

Iniziamo con il dire che per fare questo è necessario installare una versione di
vncserver 4 o superiore... ad esempio con apt-get install vnc4server

A questo punto è necessario modificare il file di X (/etc/X11/xorg.conf)

- aggiungendo nella sezione MODULES load "vnc" in questo modo:

Section "Module"
...
Load "vnc"
EndSection

(in certe situazioni, in caso di freeze del sistema, viene consigliato di


rimuovere (leggi: commentare) la voce load "DRI", maper me non è stato mai
necessario)

- aggiungendo nella sezione SCREEN la modalità di autenticazione

(FONDAMENTALE! Senza il sistema si incrania!):


Nessuna autenticazione:

Section "Screen"
...
Option "SecurityTypes" "None"
EndSection

Autenticazione basata sulla password di VNC(*)

Section "Screen"
...
Option "SecurityTypes" "VncAuth"
Option "UserPasswdVerifier" "VncAuth"
Option "PasswordFile" "/root/.vnc/passwd"
EndSection
NB: nel caso abbiate già utilizzato VNC in precedenza andatevi a fare un giretto
in /etc/syconfig/vncserver e commentate eventuali avvii di altri VNC su altri
display (A meno che non vogliate avee più possbilità di accesso, ovviamente).

NB2: ovviamente adesso per collegarvi a questa macchina con VNC non dovrete più
collegarvi a :1 ma a :0 (o nome macchina se preferite)

(*) Per configurare una password in VNC è sufficiente dare, dall'utente voluto,
il comando vncpasswd.

-------------------------------------------------------------------------
Your VNC server doesn't start: /etc/init.d/vncserver restart,
-------------------------------------------------------------------------
"unable to connect to host: connection refused (10061)"

Edit /etc/sysconfig/vncserver
chkconfig --level 345 vncserver on
The VNCSERVERS variable is a list of display:user pairs.
Make sure you have the following lines in your vncservers
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1024x768"
Then, run vncpasswd as root, it'll ask you for a password.
--------------------------------------------------------------------------------
---------------------------------------------------------------------------------
How to Remote Control Linux Server Using VNC through SSH Tunnel
--------------------------------------------------------------------------------
By: Zhiqiang Ma In: Linux

Sometimes we need to have the GUI of some application on the remote server.
ssh’s X11 forwarding with “-X” parameter is a good and fast method.

But if we want to have a whole desktop environment, vnc is a good choice.


In this post, the method of how to control remote server using vnc through a ssh
tunnel is instructed.

By using the ssh tunnel, the communication between the client and the server is
encrypted. And under some condition we can only use the port 22 of the server,
so this method is more valuable.

The default window manager of vncserver is twm.


If you want to use gnome please refer to here.

ssh’s port forwarding function give us the convenient way to do this.

1) Connect to the server and meantime set up the port forwarding ssh tunnel
------------------------------------------------------------------------

Suppose we use port 1111 on localhost for the remote control and the remote vnc
server is the first one so the default port is 5901 on the server.

We need to forward port 1111 on locahost to 5901 of the remote server.

The command is like this:

ssh -L 1111:localhost:5901 username@vnc_server

This ssh tunnel works in this way: when a packet goes to port 1111 on localhost,
this packet is forwarded to sshd running on the vnc_server, then the sshd running
on the vnc_server forwards this packet to localhost:5901 that is the port 5901 on
itself (vnc_server).

The response packet follows the opposite of the path.


So port 1111 of localhost can be regarded as the port 5901 on vnc_server.

2) Create a vncserver on vnc_server


--------------------------------

If you haven’t set the vnc password, use “vncpasswd” to set it first.
Then set up a vncserver:

vncserver

If it successes, it will give a message like this:

New ‘vnc_server:1 (username)’ desktop is vnc_server:1

1 means this is the first desktop.


The port for this desktop is 5901.
the nth desktop’s port is 590n.

3) Connect to the vnc server on client now


-------------------------------------------

On the client side:

vncviewer localhost:1111

Now enjoy it ;)

After finished using this desktop, remember to close is on the server side:

vncserver -kill :1

1 is the server number that is used.

--------------------------------------------------------------------------------

- In PuTTY: enter the IP address or hostname of your remote Fedora 14 box


(or the external IP address of the router if you’re connecting from outside the
local network). Click the + next to the SSH sub-category, then click Tunnels.

Enter the port number that corresponds to the number you set up in
/etc/sysconfig/vncservers in the Source port field (in our example, it would be
5902), then enter localhost:5902 (or a different port if applicable)

in the Destination field, then click on Add. Scroll up and click on the
Session category.

Type in a name for the session in the Saved Sessions field then press Save.

Click Open to establish the connection.

A terminal window should appear, and you’ll be prompted for your username and
password. Use your Fedora account username and password (which may be different
than the VNC password you set up).

You’ve essentially told your SSH client to “listen” for local connections
to port 5902 on localhost (your Windows box), and then tunnel those connections
over to port 5902 on the remote host (your Fedora 14 box) using your secure SSH
connection.

Once your SSH connection is established (whether by SecureCRT, PuTTY, or some


other client), open your VNC client viewer and connect to localhost:5902.

The VNC client should establish the connection, prompt for the VNC password
(which may not be the same as your Fedora account password), and then display
the remote desktop.

Step 12: Securing Things and Tidying Up


---------------------------------------

To finish securing your VNC server, there are a few final steps you should take.

First, exit your VNC client (you can just close it), then exit your SSH tunneling
session by typing exit from the command prompt.

Re-connect to your Fedora 14 box with a standard (non-tunneling) SSH connection


and become root.

Edit the /etc/sysconfig/vncservers file and add the -localhost option to the
VNCSERVERARGS line, so that it reads:

VNCSERVERARGS[2]="-geometry 1024x768 -nolisten tcp -localhost"

This option tells the VNC server not to accept remote connections from VNC
clients without a secure tunnel.

Restart the VNC server with this new option by typing:

service vncserver restart

Next, if you forwarded port 5902 on your router (or any other ports for your VNC
server) for testing purposes in Step 6 above, now would be a good time to undo
that forwarding.

You don’t need those ports forwarded anymore now that you’ve got SSH tunneling
working.

You do, however, still need the VNC ports open on your Fedora box’s firewall,
so keep any /etc/sysconfig/iptables changes you made while setting up VNC.

Optional Step: Starting Multiple VNC Sessions


----------------------------------------------

If you’d like to start multiple instances of the VNC server on your Fedora box,
you can simply edit your /etc/sysconfig/vncservers file.

Multiple instances are helpful if you want to allow multiple users to connect to
the Fedora box via VNC.

You can also set up multiple profiles for the same user, which is useful if you
want to allow the same user to access the Fedora box from multiple remote systems
that may have different screen resolutions.

If you’d like to set up an additional user (we’ll use joe in this example),
your /etc/sysconfig/vncservers file should include:
VNCSERVERS="2:clyde 3:joe"

VNCSERVERARGS[2]="-geometry 1024x768 -nolisten tcp -localhost"


VNCSERVERARGS[3]="-geometry 800x600 -nolisten tcp -localhost"

Notice that the VNCSERVERS= line has both users listed on the same line.
This is important so that when the vncserver service starts, it will start for
all users listed.

Add a separate VNCSERVERARGS= line for each new user, along with whatever
arguments you want.

Note also that by using the #3, your VNC server will now also be listening on
port 5903 for that user, so set up your firewall, tunnel, and/or VNC client
appropriately to listen and/or forward all the ports you want to use.

If you’d like to set up multiple profiles for the same user,


your /etc/sysconfig/vncservers file should include:

VNCSERVERS="2:clyde 3:clyde"

VNCSERVERARGS[2]="-geometry 1024x768 -nolisten tcp -localhost"


VNCSERVERARGS[3]="-geometry 800x600 -nolisten tcp -localhost"

Now when clyde connects to the VNCSERVER on port 2 5902, he’ll get 1024×768
desktop.
If he connects on port 5903, he’ll get a separate login instance on a separate
desktop at 800×600.

It’s possible to be connected to both ports at the same time, and have two
different desktops running.

Be sure to do a service vncserver restart after making any changes to


/etc/sysconfic/vncservers.

You should see output from all instances being started, such as:

Starting VNC server: 2:clyde


New 'server.hostname:2 (clyde)' desktop is server.hostname:2
Starting applications specified in /home/clyde/.vnc/xstartup
Log file is /home/clyde/.vnc/server.hostname:2.log
3:clyde
New 'server.hostname:3 (clyde)' desktop is server.hostname:3
Starting applications specified in /home/clyde/.vnc/xstartup
Log file is /home/clyde/.vnc/server.hostname:3.log

Congratulations!

You’ve successfully set up your remote Fedora box to accept VNC connections
securely. Enjoy your new Windows to Fedora 14 VNC connection!

---------------------------------------------------------------------------------
Configure VNC Server on CentOS 7 / RHEL 7 Funziona!
--------------------------------------------------------------------------------

by Raj in: Centos/Redhat on July 25, 2014 Last Updated on July 31, 2014

CentOS 7
The following simple guide help you to setup the VNC server on RHEL 7/CentOS 7
machines,
VNC help to share the desktop with the other machines which has a client installed.
VNC server and client are not installed by default, you need to setup the vnc
server manually.

Before installing the VNC server, let us install Gnome desktop.

[root@server ~]# yum groupinstall "GNOME Desktop" (non mi funziona!)

Install the tigervnc server and X11 fonts.

[root@server ~]# yum install tigervnc-server xorg-x11-fonts-Type1

Copy the VNC server configuration file to /etc/systemd/system/ for configuring the
system service.
While copying, you can mention which port it should listen.
By default VNC server listens on 5900, but if you setup port-offset for VNC; we can
run a service
on a sub-port of the default port 5900.
For example, if we mention port 5, it will be accessible on 5905.
You can connect the VNC server by specifying ipaddress:sub-port (192.168.2.109:5 or
192.168.2.109:5905)

[root@server ~]# cp /lib/systemd/system/[email protected]


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

Edit the copied file.

[root@server ~]# vi /etc/systemd/system/vncserver@:5.service


At the end of file, you will find the lines like below.

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c ‘/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :’
ExecStart=/sbin/runuser -l <USER> -c “/usr/bin/vncserver %i”
PIDFile=/home/<USER>/.vnc/%H%i.pid
ExecStop=/bin/sh -c ‘/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :’[Install]
WantedBy=multi-user.target
Replace <USER> with your real user, in my case i replaced with user called “raj”
with the screen size.

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c ‘/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :’
ExecStart=/sbin/runuser -l raj -c “/usr/bin/vncserver %i -geometry 1280×1024″
PIDFile=/home/raj/.vnc/%H%i.pid
ExecStop=/bin/sh -c ‘/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :’[Install]
WantedBy=multi-user.target

Add firewall rules to allow the VNC connection, the following rule is set as per
the port-offset mentioned in the previous step.
[root@server ~]# firewall-cmd --permanent --zone=public --add-port=5905/tcp
Start VNC server after switching to raj.

[raj@server ~]$ vncserver


Set the password.

You will require a password to access your desktops.

Password:
Verify:
xauth: file /home/raj/.Xauthority does not exist

New ‘localhost.localdomain:1 (raj)’ desktop is server.itzgeek.com:1

Creating default startup script /home/raj/.vnc/xstartup


Starting applications specified in /home/raj/.vnc/xstartup
Log file is /home/raj/.vnc/server.itzgeek.com:1.log

Reload the systemctl daemon

systemctl daemon-reload
Start the VNC service.

systemctl start vncserver@:5.service


Enable it on system startup.

systemctl enable vncserver@:5.service


Take remote desktop.

ipaddress:5905 or ipaddress:5
CentOS 7 - VNC Connection
CentOS 7 – VNC Connection

You will be asked to enter the password, enter the password that you have created
earlier.

CentOS 7 - VNC Authendication


CentOS 7 – VNC Authendication

Now you will get the vnc desktop session.

CentOS 7 - VNC Desktop


CentOS 7 – VNC Desktop

That’s all you have successfully configured VNC server on CentOS/RHEL 7.

Read more:
http://www.itzgeek.com/how-tos/linux/centos-how-tos/configure-vnc-server-on-centos-
7-rhel-7.html#ixzz3CCoem82j
-----------------------------------------------------------------------------------
===================================================================================
==========================================================
NUOVO
================================================================================
Configuring VNC Server on Linux (CENTOS OK)
================================================================================

init (Original Method)


systemd (New Method)
init (Original Method)
------------------

The init 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.

Install the VNC Server


-------------------

# 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.

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.

Install the VNC Server.


-----------------------

# 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.

# cp /lib/systemd/system/[email protected]
/lib/systemd/system/vncserver@:3.service

Edit the new configuration file, amending the user and startup arguments as
necessary.

User=oracle
ExecStart=/usr/bin/vncserver %i -geometry 1280x1024

Run the following command.

# systemctl daemon-reload

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

# su - oracle
$ vncpasswd
Password:
Verify:
$ 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

Hope this helps. Regards Tim...

--------------------------------------------------------------------------------
In realta io ho immesso il seguente file cancellando il default
--------------------------------------------------------------------------------

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
USER=root
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver :0 -geometry 1280x1024"
ExecStop=/sbin/runuser -l root -c "/usr/bin/vncserver -kill 0"

[Install]
WantedBy=multi-user.target

--------------------------------------------------------------------------------
[root@vm2009 system]# netstat -an | grep LISTEN

tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN


SSH
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
SENDMAIL
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
MYSQL
tcp 0 0 0.0.0.0:53579 0.0.0.0:* LISTEN
VNCSERVER
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 :::80 :::* LISTEN
HTTP
tcp 0 0 :::22 :::* LISTEN
SSH
tcp 0 0 :::443 :::* LISTEN
HTTPS
tcp 0 0 :::60553 :::* LISTEN
tcp 0 0 :::111 :::* LISTEN
----------------------------------------------------------------------------------
#netstat -anlp | grep vnc

tcp 0 0 0.0.0.0:5900 0.0.0.0:* LISTEN


3432/Xvnc
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN
3432/Xvnc
tcp 0 0 0.0.0.0:5800 0.0.0.0:* LISTEN
3432/Xvnc
tcp 0 0 192.168.1.2:5800 192.168.1.7:42621 ESTABLISHED
3432/Xvnc
tcp6 0 0 :::6000 :::* LISTEN
3432/Xvnc
----------------------------------------------------------------------------------
Fedora 17 - VNC server setup
----------------------------------------------------------------------------------

This guide explains how to setup a multi-user VNC server on Fedora 17

Follow up:

Many things have changed since I last delved into this back in Fedora 8.

- the service command is now replaced with systemctl

- chkconfig only controls sysv based services - not systemd. Instead use systemctl
with no arguments

/etc/sysconfig/vncservers has been replaced with


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

Details:

1. Install the required packages

# yum install xorg-x11-font* tigervnc-server tigervnc-server-module

2. Copy the default vnc config file to the /etc/systemd/system/ . You will need
to copy a file for each user who will be connecting to the server and assign a
Display (starting at number 1)

In my case, UserA is assigned to Display 1 and UserB is assigned to Display 2

# cp /lib/systemd/system/[email protected]
/etc/systemd/system/vncserver@:1.service

# cp /lib/systemd/system/[email protected]
/etc/systemd/system/vncserver@:2.service

N.B Io ho utilizzato /etc/systemd/system/vncserver@:0.service

[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill :0 > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver :0 -geometry 1024x768 "
PIDFile=/root/.vnc/%H:0.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill :0 > /dev/null 2>&1 || :'

3. You will need to edit each of these files to configure the VNC session for each
user.

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

Find the line which starts with ExecStartPre= and concentrate on that and the next
2 lines after it.

You'll need to update all instances the <USER> variable with the actual username
e.g. UserA

Update all instances of %i to :1 for your display number.

Make sure your ExecStart= statement looks like this:

ExecStart=/sbin/runuser -l chris -c "/usr/bin/vncserver :1 -geometry 1280x720 -


depth 16 -fp /usr/share/X11/fonts/misc"

4. Set a VNC password for each user (max: 8 characters)

Log in as each user and execute the command vncpasswd for each account.

This will prompt for a password.

This will crfeate a .vnc folder in each user's home directory and it stores the
hashed password in there.
5. Enable the service and start it (for each instance)

# systemctl enable vncserver@:1.service

# systemctl enable vncserver@:2.service

# systemctl start vncserver@:1.service

# systemctl start vncserver@:2.service

6. netstat -lnt to check if the service is running

you will see a reference to port 5900, then sequential ports upwards from there to
specify your individual user's entry points

In my case, UserA had Display 1 assigned so they connect to port 5901. UserB had
Display 2 assigned so they connect to port 5902.

NOTE: Make sure these ports are allowed through the firewall

__________________________________

VNC Client Connection:

In you VNC client software, it will ask for a hostname or IP address, then a
Display number and password

The display number can take 2 forms: either 5901 or 1

e.g A.B.X.Y:5901 OR A.B.X.Y:1

Once connected, you will be able to control a remote session in that user's
account.

Be careful not to log out of the remote session as you will then need to restart
the service.

Just clost the VNC client window - you may want to set a password on the
screensaver for your remote session.

If you need to restart the VNC service, see below:

# systemctl restart vncserver@:1.service

# systemctl restart vncserver@:2.service

---------------------------------------------------------------------------------

vncserver = x: 123456: Il vncserver opzione di avvio e' stato introdotto in


SystemRescueCD-1.0.2.
Questo opzioni forze del sistema per configurare il server VNC e per avviare
automaticamente durante l'avvio.
Dovete sostituire X con il numero di schermi che si desidera, con 123456 e la tua
password
La password deve essere compresa tra 5 e 8 caratteri, altrimenti l'opzione di avvio
verra' ignorata.
In altre parole l'opzione vncserver = 2: MyPaSsWd ti consentira' di accedere a due
schermi (display = 0 su tcp/5900 e dislpay = 1 a tcp/5901).

-----------------------------------------------------------------------------------
-------------------------------------------------------------
Fedora 17 - VNC server setup
-----------------------------------------------------------------------------------
-------------------------------------------------------------

This guide explains how to setup a multi-user VNC server on Fedora 17

Follow up:

Many things have changed since I last delved into this back in Fedora 8.

- the service command is now replaced with systemctl

- chkconfig only controls sysv based services - not systemd. Instead use systemctl
with no arguments

/etc/sysconfig/vncservers has been replaced with


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

Details:

1. Install the required packages

# yum install xorg-x11-font* tigervnc-server tigervnc-server-module

2. Copy the default vnc config file to the /etc/systemd/system/ .


You will need to copy a file for each user who will be connecting to the server
and assign
a Display (starting at number 1)

In my case, UserA is assigned to Display 1 and UserB is assigned to Display 2

# cp /lib/systemd/system/[email protected]
/etc/systemd/system/vncserver@:1.service

# cp /lib/systemd/system/[email protected]
/etc/systemd/system/vncserver@:2.service

N.B Io ho utilizzato /etc/systemd/system/vncserver@:0.service

[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill :0 > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver :0 -geometry 1024x768 "
PIDFile=/root/.vnc/%H:0.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill :0 > /dev/null 2>&1 || :'

3. You will need to edit each of these files to configure the VNC session for each
user.

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

Find the line which starts with ExecStartPre= and concentrate on that and the next
2 lines after it.

You'll need to update all instances the <USER> variable with the actual username
e.g. UserA

Update all instances of %i to :1 for your display number.

Make sure your ExecStart= statement looks like this:

ExecStart=/sbin/runuser -l chris -c "/usr/bin/vncserver :1


-geometry 1280x720
-depth 16
-fp /usr/share/X11/fonts/misc"

4. Set a VNC password for each user (max: 8 characters)

Log in as each user and execute the command vncpasswd for each account.

This will prompt for a password.

This will crfeate a .vnc folder in each user's home directory and it stores the
hashed password
in there.

5. Enable the service and start it (for each instance)

# systemctl enable vncserver@:1.service


# systemctl enable vncserver@:2.service
# systemctl start vncserver@:1.service
# systemctl start vncserver@:2.service

6. netstat -lnt to check if the service is running

you will see a reference to port 5900, then sequential ports upwards from there to
specify your
individual user's entry points

In my case, UserA had Display 1 assigned so they connect to port 5901.


UserB had Display 2 assigned so they connect to port 5902.

NOTE: Make sure these ports are allowed through the firewall

-------------------------------------------------------------------------------
VNC Client Connection:
---------------------------------------------------------------------------------

In you VNC client software, it will ask for a hostname or IP address, then a
Display number and
password

The display number can take 2 forms: either 5901 or 1

e.g A.B.X.Y:5901 OR A.B.X.Y:1

Once connected, you will be able to control a remote session in that user's
account.

Be careful not to log out of the remote session as you will then need to restart
the service.
Just clost the VNC client window - you may want to set a password on the
screensaver for your
remote session.

If you need to restart the VNC service, see below:

# systemctl restart vncserver@:1.service


# systemctl restart vncserver@:2.service

------------------
Created symlink
/etc/systemd/system/multi-user.target.wants/vncserver-x11-serviced.service
→ /lib/systemd/system/vncserver-x11-
serviced.service.

root@raspberry:~# ps -elf | grep vnc


/usr/bin/vncserver-x11-serviced -fg
/usr/bin/vncserver-x11-core -service

-----------------------------------------------------------------------------------
-------------------------------------------------------------
AZARTICOLO: RealVNC : Come utilizzare VNC Server in Virtual Mode in unione a Xorg
server?
-----------------------------------------------------------------------------------
-------------------------------------------------------------

RealVNC
Updated July 21, 2022 18:34

Di default VNC Server in Virtual Mode utilizza una versione di Xorg server built-
in in Xvnc eXvnc-core.
Troppo vecchio non funziona l'accellerazione hw

Con VNC Connect 6.2.0, posso indicare a VNC Server di utilizzare l'ultima versione
del Xorg
server gia' presente nel sistema. Valido soprattutto per le versioni Redhat.

Nota: Se si usa Raspberry Pi OS (il vecchio Raspbian), si dovrebbe continuare ad


utilizzare Xvnc.
Questo vuol dire che occorre ancora configurare un ambiente desktop come PIXEL.

Requirements
---------------------

Devono essere presenti Xorg e Xorg dummy video driver

apt install xserver-xorg-video-dummy

Ovviamente deve essere presente l'ambiente VNC Connect 6.2.0+

Abilitare Xorg server


-------------------------------

Per abilitare Xorg server per tutti gli utenti eseguire coem root
vncinitconfig -enable-system-xorg

a me da :
vncinitconfig -enable-system-xorg
WARNING: SystemXorg is not supported on this distribution.
You may encounter issues when using it.
Enabling SystemXorg for all users.
(re-run as a normal user to enable for just that user)
Are you sure? [y/n]: n

To disable the system Xorg server and use Xvnc again, run
vncinitconfig -disable-system-xorg.

Configuring VNC Server


--------------------------------------

VNC Server parameters

VNC Server parameters can be specified in the following new configuration files:

/etc/vnc/config.d/vncserver-x11-virtual (for all users)


~/.vnc/config.d/vncserver-x11-virtual (just for you)

Note that the vncinitconfig -enable-system-xorg script offers to copy over existing
parameters from
/etc/vnc/config.d/Xvnc and ~/.vnc/config.d/Xvnc respectively for you.

Note: The RandR VNC Server parameter cannot enable users to switch between
available screen
resolutions. See Xorg configuration, below.

Xorg options
--------------------

Xorg server options can continue to be set in the following files:

/etc/vnc/config
/etc/vnc/config.custom
~/.vnc/config (ignored if the -config flag is used, below)

...or in a custom file identified by the vncserver-virtual -config FILE-PATH flag


at start-up.

These options are passed directly to the system Xorg server.


Consult the Xorg man page for a list of valid options;
invalid options cause errors.
Note that the following options supported by Xvnc are not supported:
-blackpixel, -whitepixel, -linebias, -pixdepths, -pixelformat, -screen.

Xorg configuration
-----------------------------

Custom Xorg settings can be specified in the new

/etc/X11/vncserver-virtual-dummy.conf

file.

Note the VNC Server RandR parameter cannot be used to enable a connected VNC Viewer
user
to cycle between available screen resolutions during a remote control session.
The connected user should use the standard Screen Display or Monitor app instead.
Custom resolutions can be specified using Modelines.
Alternatively, you can install the RealVNC dummy driver to restore use of RandR.

Xstartup
-------------

Xstartup scripts can continue to be used to specify desktop environments and


applications for
virtual desktops in the same way as for Xvnc.

Installing from a network share


-----------------------------------------------

If you're following these instructions to install VNC Server on a central computer,


then perform
the following operation after step 5 and before step 6:

5a) Run the command vncinitconfig -virtual-xorg-conf as root to generate a


/etc/X11/vncserver-virtual-dummy.conf file.

Known issues
---------------------

When using the Xfce or KDE desktop environments, some fonts may appear small,
depending
on the screen resolution.

To fix this for Xfce, navigate to Applications > Settings > Appearance and enable
Custom DPI
setting on the Fonts tab, making sure this is set to 96.

To fix this for KDE, navigate to System Settings > Application Appearance and
enable Force fonts DPI on the Fonts tab, making sure this is set to 96.

KDE’s keyboard layout management


(KDE System Settings -> Input Devices -> Keyboard -> Layouts -> Configure layouts)
can cause issues with certain keys/applications. Please disable this setting if you
encounter
any issues.

==================================================================================
REMOVE GNOME
==================================================================================
https://raspberrytips.com/pimp-my-raspberry-pi/
==================================================================================

apt-get remove gnome-session


apt-get remove gnome-shell
apt-get remove gnome-control-center
apt-get remove gnome-shell-extension*
apt-get remove gnome-themes-extra
apt-get remove gnome-terminal
apt-get remove gnome-session
apt-get remove gnome-session-custom-session
apt-cache search gnome-session
apt-get remove gnome-desktop
apt-get remove gnome-keyring
apt-get remove gnome-common
apt-get remove gnome-screenshot
apt-get autoremove

apt-get remove gnome-session

I seguenti pacchetti saranno RIMOSSI:


chrome-gnome-shell
gdm3
gnome-shell gnome-shell-extension-prefs
gnome-tweak-tool gnome-tweaks

Rimozione di chrome-gnome-shell (10.1-5)...


Rimozione di gdm3 (3.38.2.1-1)...
Rimozione di gnome-tweak-tool (3.34.0-4)...
Rimozione di gnome-tweaks (3.34.0-4)...
Rimozione di gnome-shell-extension-prefs (3.38.6-1~deb11u1)...
Rimozione di gnome-shell (3.38.6-1~deb11u1)...

apt-get remove gnome-control-center


gnome-control-center

root@raspberry:/usr/bin# apt-cache pkgnames | grep gnome

root@raspberry:/usr/bin# apt-get remove gnome-shell-extension*


Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze... Fatto
Lettura informazioni sullo stato... Fatto

root@raspberry:/usr/bin# apt-cache pkgnames | grep gnome

I seguenti pacchetti saranno RIMOSSI:


evolution-data-server gnome-keyring
0 aggiornati, 0 installati, 2 da rimuovere e 0 non aggiornati.
Dopo quest'operazione, verranno liberati 7.581 kB di spazio su disco.
Continuare? [S/n] S
(Lettura del database... 113529 file e directory attualmente installati.)
Rimozione di evolution-data-server (3.38.3-1+deb11u2)...
Rimozione di gnome-keyring (3.36.0-1)...

root@raspberry:/usr/bin# apt-get remove gnome-common


Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze... Fatto
Lettura informazioni sullo stato... Fatto

I seguenti pacchetti saranno RIMOSSI:

Rimozione di malcontent-gui (0.10.0-2)...


Rimozione di malcontent (0.10.0-2)...
Rimozione di accountsservice (0.6.55-3)...
Rimozione di gnome-user-share (3.34.0-2)...
Rimozione di libapache2-mod-dnssd (0.6-3.2)...
Rimozione di apache2-bin (2.4.56-1~deb11u2)...
Rimozione di apg (2.2.3.dfsg.1-5+b1)...
Rimozione di bolt (0.9.1-1)...
Rimozione di libcheese-gtk25:arm64 (3.38.0-3)...
Rimozione di libcheese8:arm64 (3.38.0-3)...
Rimozione di cheese-common (3.38.0-3)...
Rimozione di cracklib-runtime (2.9.6-3.4)...
Rimozione di ibus (1.5.23-2)...
Rimozione di dconf-cli (0.38.0-2)...
Rimozione di desktop-base (11.0.3)...
Rimozione di libedataserverui-1.2-2:arm64 (3.38.3-1+deb11u2)...
Rimozione di libebook-1.2-20:arm64 (3.38.3-1+deb11u2)...
Rimozione di libedata-book-1.2-26:arm64 (3.38.3-1+deb11u2)...
Rimozione di libebook-contacts-1.2-3:arm64 (3.38.3-1+deb11u2)...
Rimozione di fonts-quicksand (0.2016-2.1)...
dpkg: attenzione: nel rimuovere fonts-quicksand, la directory
"/usr/share/fonts/truetype/quicksand" è risultata non vuota e non viene rimossa
Rimozione di gir1.2-accountsservice-1.0:arm64 (0.6.55-3)...
Rimozione di gir1.2-atspi-2.0:arm64 (2.38.0-4+deb11u1)...
Rimozione di gir1.2-gcr-3:arm64 (3.38.1-2)...
Rimozione di gir1.2-gck-1:arm64 (3.38.1-2)...
Rimozione di gir1.2-mutter-7:arm64 (1:3.38.6-2~deb11u2+rpt6)...
Rimozione di gir1.2-gnomedesktop-3.0:arm64 (3.38.5-3)...
Rimozione di gir1.2-gdesktopenums-3.0:arm64 (3.38.0-2+rpt1)...
Rimozione di gir1.2-gdm-1.0:arm64 (3.38.2.1-1)...
Rimozione di gir1.2-geoclue-2.0:arm64 (2.5.7-3)...
Rimozione di gir1.2-gnomebluetooth-1.0:arm64 (3.34.3-2)...
Rimozione di gir1.2-graphene-1.0:arm64 (1.10.4+dfsg1-1)...
Rimozione di gir1.2-gstreamer-1.0:arm64 (1.18.4-2.1)...
Rimozione di gir1.2-gweather-3.0:arm64 (3.36.1-3)...
Rimozione di gir1.2-handy-0.0:arm64 (0.0.13-3)...
Rimozione di python3-ibus-1.0 (1.5.23-2)...
Rimozione di gir1.2-ibus-1.0:arm64 (1.5.23-2)...
Rimozione di gir1.2-json-1.0:arm64 (1.6.2-1)...
Rimozione di gir1.2-malcontent-0:arm64 (0.10.0-2)...
Rimozione di gir1.2-nma-1.0:arm64 (1.8.30-1+rpt1)...
Rimozione di gir1.2-nm-1.0:arm64 (1.30.6-1+deb11u1)...
Rimozione di gir1.2-soup-2.4:arm64 (2.72.0-2)...
Rimozione di gir1.2-upowerglib-1.0:arm64 (0.99.11-2)...
Rimozione di gjs (1.66.2-1)...
Rimozione di gkbd-capplet (3.26.1-1)...
Rimozione di gnome-backgrounds (3.38.0-1)...
Rimozione di gnome-control-center-data (1:3.38.4-1)...
Rimozione di gnome-session-bin (3.38.0-4+rpt2)...
Rimozione di libmutter-7-0:arm64 (1:3.38.6-2~deb11u2+rpt6)...
Rimozione di gnome-keyring-pkcs11:arm64 (3.36.0-1)...
Rimozione di gnome-online-accounts (3.38.0-3)...
Rimozione di gnome-session-common (3.38.0-4+rpt2)...
Rimozione di gnome-settings-daemon (3.38.2-1+rpt1)...
Rimozione di gnome-settings-daemon-common (3.38.2-1+rpt1)...
Rimozione di gnome-shell-common (3.38.6-1~deb11u1)...
Rimozione di gnome-user-docs (3.38.2-1)...
Rimozione di gstreamer1.0-clutter-3.0:arm64 (3.0.27-2)...
Rimozione di gstreamer1.0-pipewire:arm64 (0.3.19-4)...
Rimozione di gstreamer1.0-plugins-ugly:arm64 (1.18.4-2)...
Rimozione di ibus-data (1.5.23-2)...
Rimozione di ibus-gtk:arm64 (1.5.23-2)...
Rimozione di ibus-gtk3:arm64 (1.5.23-2)...
Rimozione di iio-sensor-proxy (3.0-2)...
Rimozione di im-config (0.46-1+deb11u1)...
Rimozione di liba52-0.7.4:arm64 (0.7.4-20)...
Rimozione di libmalcontent-ui-0-0:arm64 (0.10.0-2)...
Rimozione di libaccountsservice0:arm64 (0.6.55-3)...
Rimozione di libappstream-glib8:arm64 (0.7.18-1)...
Rimozione di libaprutil1-ldap:arm64 (1.6.1-5+deb11u1)...
Rimozione di libaprutil1-dbd-sqlite3:arm64 (1.6.1-5+deb11u1)...
Rimozione di libaprutil1:arm64 (1.6.1-5+deb11u1)...
Rimozione di libapr1:arm64 (1.7.0-6+deb11u2)...
Rimozione di network-manager-gnome (1.20.0-3)...
Rimozione di libayatana-appindicator3-1 (0.5.5-2+deb11u2)...
Rimozione di libayatana-indicator3-7:arm64 (0.8.4-1+deb11u2)...
Rimozione di libayatana-ido3-0.4-0:arm64 (0.8.2-1)...
Rimozione di libedata-cal-2.0-1:arm64 (3.38.3-1+deb11u2)...
Rimozione di libclutter-gtk-1.0-0:arm64 (1.8.4-4)...
Rimozione di libclutter-gst-3.0-0:arm64 (3.0.27-2)...
Rimozione di libclutter-1.0-0:arm64 (1.26.4+dfsg-2)...
Rimozione di libclutter-1.0-common (1.26.4+dfsg-2)...
Rimozione di libcogl-common (1.22.8-2)...
Rimozione di libcogl-pango20:arm64 (1.22.8-2)...
Rimozione di libcogl-path20:arm64 (1.22.8-2)...
Rimozione di libcogl20:arm64 (1.22.8-2)...
Rimozione di libcolord-gtk1:arm64 (0.1.26-2)...
Rimozione di libpwquality1:arm64 (1.4.4-1)...
Rimozione di libcrack2:arm64 (2.9.6-3.4)...
Rimozione di libdbusmenu-gtk3-4:arm64 (18.10.20180917~bzr492+repack1-2)...
Rimozione di libdbusmenu-glib4:arm64 (18.10.20180917~bzr492+repack1-2)...
Rimozione di libebackend-1.2-10:arm64 (3.38.3-1+deb11u2)...
Rimozione di libecal-2.0-1:arm64 (3.38.3-1+deb11u2)...
Rimozione di libflatpak0:arm64 (1.10.8-0+deb11u1)...
Rimozione di libgdm1 (3.38.2.1-1)...
Rimozione di rygel (0.40.0-1)...
Rimozione di librygel-server-2.6-2:arm64 (0.40.0-1)...
Rimozione di libgeoclue-2-0:arm64 (2.5.7-3)...
Rimozione di libgweather-3-16:arm64 (3.36.1-3)...
Rimozione di libgeocode-glib0:arm64 (3.26.2-2)...
Rimozione di libges-1.0-0 (1.18.4-2)...
Rimozione di libgjs0g:arm64 (1.66.2-1)...
Rimozione di libgnome-autoar-0-0:arm64 (0.2.4-3)...
Rimozione di libgnome-bluetooth13:arm64 (3.34.3-2)...
Rimozione di libgnomekbd8:arm64 (3.26.1-1)...
Rimozione di libgnomekbd-common (3.26.1-1)...
Rimozione di libgoa-backend-1.0-1:arm64 (3.38.0-3)...
Rimozione di libgsound0:arm64 (1.0.2-5)...
Rimozione di librygel-renderer-2.6-2:arm64 (0.40.0-1)...
Rimozione di libgupnp-av-1.0-2 (0.12.11-2)...
Rimozione di libgupnp-dlna-2.0-3 (0.10.5-4)...
Rimozione di libgweather-common (3.36.1-3)...
Rimozione di libhandy-0.0-0:arm64 (0.0.13-3)...
Rimozione di libibus-1.0-5:arm64 (1.5.23-2)...
Rimozione di libical3:arm64 (3.0.9-2)...
Rimozione di libmalcontent-0-0:arm64 (0.10.0-2)...
Rimozione di libmediaart-2.0-0:arm64 (1.9.4-3)...
Rimozione di libmozjs-78-0:arm64 (78.4.0-2)...
Rimozione di libmpeg2-4:arm64 (0.5.1-9)...
Rimozione di libnautilus-extension1a:arm64 (3.38.2-1+deb11u1)...
Rimozione di libnma0:arm64 (1.8.30-1+rpt1)...
Rimozione di libnma-common (1.8.30-1+rpt1)...
Rimozione di libnss-myhostname:arm64 (247.3-7+deb11u2)...
Checking NSS setup...
Rimozione di libopencore-amrnb0:arm64 (0.1.5-1)...
Rimozione di libopencore-amrwb0:arm64 (0.1.5-1)...
Rimozione di libostree-1-1:arm64 (2020.8-2+deb11u1)...
Rimozione di libpam-gnome-keyring:arm64 (3.36.0-1)...
Rimozione di libphonenumber8:arm64 (8.12.16-4)...
Rimozione di pipewire:arm64 (0.3.19-4)...
Rimozione di pipewire-bin (0.3.19-4)...
Rimozione di libpipewire-0.3-modules:arm64 (0.3.19-4)...
Rimozione di libpipewire-0.3-0:arm64 (0.3.19-4)...
Rimozione di plymouth-label (0.9.5-3+rpt2)...
Rimozione di plymouth (0.9.5-3+rpt2)...
update-initramfs: deferring update (trigger activated)
Rimozione di libplymouth5:arm64 (0.9.5-3+rpt2)...
Rimozione di libprotobuf23:arm64 (3.12.4-1)...
Rimozione di libpwquality-common (1.4.4-1)...
Rimozione di librygel-db-2.6-2:arm64 (0.40.0-1)...
Rimozione di librygel-core-2.6-2:arm64 (0.40.0-1)...
Rimozione di libsidplay1v5:arm64 (1.36.60-1)...
Rimozione di libspa-0.2-modules:arm64 (0.3.19-4)...
Rimozione di upower (0.99.11-2)...
Rimozione di libupower-glib3:arm64 (0.99.11-2)...
Rimozione di libxcb-res0:arm64 (1.14-3)...
Rimozione di libxkbcommon-x11-0:arm64 (1.0.3-2)...
Rimozione di libxklavier16:arm64 (5.4-4)...
Rimozione di mobile-broadband-provider-info (20201225-1)...
Rimozione di mutter-common (1:3.38.6-2~deb11u2+rpt6)...
Rimozione di p11-kit (0.23.22-1)...
Rimozione di p11-kit-modules:arm64 (0.23.22-1)...
Rimozione di realmd (0.16.3-3)...
Rimozione di switcheroo-control (2.4-3)...
Rimozione di xwayland (2:1.20.11-1+rpt3+deb11u6)...
Rimozione di libedataserver-1.2-25:arm64 (3.38.3-1+deb11u2)...
Rimozione di evolution-data-server-common (3.38.3-1+deb11u2)...
Rimozione di libgnome-desktop-3-19:arm64 (3.38.5-3)...
Rimozione di gnome-desktop3-data (3.38.5-3)...
Rimozione di libcamel-1.2-62:arm64 (3.38.3-1+deb11u2)...
Rimozione di libgee-0.8-2:arm64 (0.20.4-1)...
Rimozione di libxkbregistry0:arm64 (1.0.3-2)...
Elaborazione dei trigger per desktop-file-utils (0.26-1)...
Elaborazione dei trigger per initramfs-tools (0.140)...
Elaborazione dei trigger per hicolor-icon-theme (0.17-2)...
Elaborazione dei trigger per gnome-menus (3.36.0-1)...
Elaborazione dei trigger per libglib2.0-0:arm64 (2.66.8-1)...
Elaborazione dei trigger per libglib2.0-0:armhf (2.66.8-1)...
Elaborazione dei trigger per libgtk-3-0:arm64 (3.24.24-4+rpt12+deb11u3)...
Elaborazione dei trigger per libgtk2.0-0:arm64 (2.24.33-2+rpt1)...
Elaborazione dei trigger per libc-bin (2.31-13+rpt2+rpi1+deb11u5)...
Elaborazione dei trigger per man-db (2.9.4-2)...
Elaborazione dei trigger per dbus (1.12.24-0+deb11u1)...
Elaborazione dei trigger per udev (247.3-7+deb11u2)...
Elaborazione dei trigger per mailcap (3.69)...
Elaborazione dei trigger per fontconfig (2.13.1-4.2)...

root@raspberry:/usr/bin# apt-get remove gnome-screenshot


Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze... Fatto
Lettura informazioni sullo stato... Fatto

Rimozione di gnome-screenshot (3.38.0-1)...

root@raspberry:/usr/bin# lx
lxappearance lxmusic lxrandr
lxsession-default-apps lxsettings-daemon
lxclipboard lxpanel lxsession
lxsession-default-terminal lxtask
lxde-logout lxpanelctl lxsession-db
lxsession-logout lxterm
lxlock lxpolkit lxsession-default
lxsession-xdg-autostart lxterminal
root@raspberry:/usr/bin# lx
lxappearance lxmusic lxrandr
lxsession-default-apps lxsettings-daemon
lxclipboard lxpanel lxsession
lxsession-default-terminal lxtask
lxde-logout lxpanelctl lxsession-db
lxsession-logout lxterm
lxlock lxpolkit lxsession-default
lxsession-xdg-autostart lxterminal
root@raspberry:/usr/bin# lx
-----------------------------------------------------------------------------------
-------------------------------------------------------------

==================================================================================
How To Start VNC Session With Gnome Desktop?
==================================================================================

I'm trying to start a VNC session with the Gnome Desktop as follows:

Server Side

Configure .vnc/xstartup file to:

#!/bin/sh

# Uncomment the following two lines for normal desktop:


# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup


[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
vnc4server start a session on the server:

selenium@selenium-grid:~$ vnc4server -geometry 1024x768 :1

New 'selenium-grid:1 (selenium)' desktop is selenium-grid:1

Starting applications specified in /home/selenium/.vnc/xstartup


Log file is /home/selenium/.vnc/selenium-grid:1.log
Start a new section of xvnc4viewer on the client side:

$ xvnc4viewer <IP my server>:<Port my server>


Result:

enter image description here

I'm trying to start a VNC session with the Gnome Desktop with the following
settings and commands:
Kill the session of vnc4server on the server side:

selenium@selenium-grid:~$ vnc4server -kill :1


Killing Xvnc4 process ID 10747
edit .vnc/xstartup file to on the server side:

nano .vnc/xstartup
Edited file:

#!/bin/sh

# Uncomment the following two lines for normal desktop:


unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
/usr/bin/gnome-session &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup


[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
# x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
# x-window-manager &
Start a new session of vnc4server in server

selenium@selenium-grid:~$ vnc4server -geometry 1024x768 :1

New 'selenium-grid:1 (selenium)' desktop is selenium-grid:1

Starting applications specified in /home/selenium/.vnc/xstartup


Log file is /home/selenium/.vnc/selenium-grid:1.log
Client side

$ xvnc4viewer <IP my server>:<Port my server>


Result: enter image description here

Because my Gnome Desktop session is not appearing? What am I doing wrong?

install these packages:

apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal


use this startup file:

#!/bin/sh

export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup


[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &

gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &
================================================================================
IMPLEMENTAZIONE
================================================================================

systemctl status x11-common

x11-common.service
Loaded: masked (/dev/null; bad)
Active: inactive (dead)

I tried systemctl unmask x11-common and systemctl unmask x11-common.service


but that did not change anything.

How do I unmask it?

The commands you are using are both correct. See also the manual.

It seems the unmask command fails when there is no existing unit file in the system
other than
the symlink to /dev/null. If you mask a service, then that creates a new symlink to
/dev/null in
/etc/systemd/system where systemd looks for unit files to load at boot.
In this case, there is no real unit file.

Others seem to have similar issues

x11-common.service was also masked on my system.

You can fix it like this:

First check that the unit file is a symlink to /dev/null

file /lib/systemd/system/x11-common.service

it should return:

/lib/systemd/system/x11-common.service: symbolic link to /dev/null

in which case, delete it

rm /lib/systemd/system/x11-common.service
Since you changed a unit file, you need to run this:

systemctl daemon-reload
now check the status:

systemctl status x11-common


if it doesn't say loaded and running (if the circle is still red), reinstall the
package:

apt-get install --reinstall x11-common


and reload the daemon again

systemctl daemon-reload
and check status once more

systemctl status x11-common

Now it's green and running :)


The service has no systemd unit file, but systemd happily uses the script for it in
/etc/init.d instead.

Quindi per passare da VNC service a VNC virtual:

systemctl stop vncserver-x11-serviced


systemctl disable vncserver-x11-serviced
rm /lib/systemd/system/x11-common.service
systemctl daemon-reload
systemctl status x11-common
systemctl start x11-common
systemctl status x11-common
systemctl status x11-common.service
systemctl enable vncserver-virtuald.service
systemctl start vncserver-virtuald.service
systemctl status vncserver-virtuald.service

-----------------------------------------------------------------------------------
-------------------------------------------------------------

L'unico modo di farlo partire e':


/usr/bin/vncserver :0 -geometry 1280x720 -depth 24 -Randr 1280x720,1366x768

/etc/X11/openbox# vi autostart

#xfce-mcs-manager &
/usr/bin/conky -c /etc/conky/conky.conf -d &

#vncserver:0
# Attendi che openbox-session si avvii completamente
sleep 5
# Avvio del VNC server su display :0
systemctl start vncserver-x11-serviced.service

pcmanfm --desktop -d &


-------------------------------------
CLIENT vncviewer raspberry:1

Lanciando:
vncserver :1 -geometry 1280x720 -depth 24

VNC(R) Server 7.0.1 (r49073) ARMv8-A (Feb 13 2023 11:40:10)


Copyright (C) RealVNC Ltd.
RealVNC and VNC are trademarks of RealVNC Ltd and are protected by trademark
registrations and/or pending trademark applications in the European Union,
United States of America and other jurisdictions.
Protected by UK patent 2481870; US patent 8760366; EU patent 2652951.
See https://www.realvnc.com for information on VNC.
For third party acknowledgements see:
https://www.realvnc.com/docs/7/foss.html
OS: Debian GNU/Linux 11, Linux 6.1.28, aarch64

Xorg driver not found: Xorg void input driver


You've set vncserver-virtual to use the system Xorg server. For more information
on this alternative implementation, please see:
https://www.realvnc.com/doclink/kb-546

Running applications in /etc/vnc/xstartup


VNC Server catchphrase: "Page transit stadium. Media John lecture."
signature: 59-a9-f6-bd-99-e4-2d-3d

Log file is /root/.vnc/raspberry:1.log


New desktop is raspberry:1 (192.168.1.5:1)

Viene lanciato:

root@raspberry:~# ps -elf | grep vnc

/usr/bin/vncserver-virtuald -fg
vncserver :1 -geometry 1280x720 -depth 24
/usr/lib/xorg/Xorg :1 -config vncserver-virtual-dummy.conf -auth /root/.Xauthority
-pn -depth 24
/usr/bin/vncserver-x11-core -virtual -newinstance -geometry 1280x720
/usr/bin/vncagent virtual 0
/bin/sh /etc/vnc/xstartup

al boot salgono:

/usr/bin/vncserver-virtuald -fg
/usr/bin/vncserver-x11-serviced -fg
/usr/bin/vncserver-x11-core -service

root@raspberry:/usr/bin# ls -la vnc*

vncagent
vncagent-raspi
vncinitconfig
vnclicense
vnclicensewiz
vncpamhelper
vncpasswd

vncserver -> vncserver-virtual


vncserver-virtuald

vncserverui
vncserver-virtual
vncserver-x11
vncserver-x11-core
vncserver-x11-serviced
vncviewer

xrandr --output default --mode 1280x720

Impostazioni DPI tramite xrandr:


Puoi provare a modificare il DPI tramite il comando xrandr.
Apri un terminale e esegui il seguente comando:
xrandr --dpi xxx,

sostituendo "xxx" con il valore del DPI desiderato. Ad esempio, xrandr --dpi 96.

-----------------------------------------------------------------------------------
-------------------------------------------------------------
Al boot partono
/usr/bin/vncserver-x11-serviced -fg
/usr/bin/vncserver-x11-core -service

ps -elf | grep vnc


/usr/bin/vncserver-x11-serviced -fg
/usr/bin/vncserver-x11-core -service

systemctl status vncserver-x11-serviced

● vncserver-x11-serviced.service - VNC Server in Service Mode daemon


Loaded: loaded (/lib/systemd/system/vncserver-x11-serviced.service; enabled;
vendor preset: enabled)
Active: active (running) since Sat 2023-06-17 09:03:41 CEST; 1min 26s ago
Main PID: 2835 (vncserver-x11-s)
Tasks: 2 (limit: 779)
CPU: 784ms
CGroup: /system.slice/vncserver-x11-serviced.service
├─2835 /usr/bin/vncserver-x11-serviced -fg
└─2836 /usr/bin/vncserver-x11-core -service

systemd[1]: Started VNC Server in Service Mode daemon.


vncserver-x11[2836]: ServerManager: Server started
vncserver-x11[2836]: ConsoleDisplay: Cannot find a running X server on vt1
vncserver-x11[2836]: Connections: connected: 192.168.1.2::33774 (TCP)
vncserver-x11[2836]: Connections: authenticated: 192.168.1.2::33774 (TCP), as
(anonymous) (d permissions)
vncserver-x11[2836]: Connections: disconnected: 192.168.1.2::33774 (TCP)
([EndOfStream] Disconnection by client)

Dato l'errore installo:


apt-get install openbox openbox-menu openbox-dev openbox-lxde-session
Occorre prima far partire startx e poi i server vnc

You might also like