Vncserver
Vncserver
Vncserver
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.
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.
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.
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:
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
----------------------------------------------------------------------------
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"
For the next step, you should be logged in to your Fedora box as the user whose
desktop you’ll want to access.
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:
Password:
Verify:
xauth: creating new authority file /home/stevej/.Xauthority
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).
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 &
# twm &
startkde &
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:
# 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.
# setsebool -P sshd_forward_ports 1
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.
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.
If you’re using additional ports for VNC, add a separate line for each.
Once you’ve added the appropriate line(s), restart your firewall with:
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).
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.
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.
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.
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).
Save your new connection, then click Connect. A terminal window should appear,
and you’ll be prompted for your username and password.
--------------------------------------------------------------------------------
VNC SERVER
--------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
--------------------
Configurare VNC Server
-----------------------------------------------------------------------------------
--------------------
Configurazione Server
-----------------
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.
Configurazione Account
------------------
$ vncserver
Password:
Verify:
#!/bin/sh
Avviare il server
-------------------
Connettersi
------------
$ vncviewer &
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.
VNCSERVERS = "1:NOME_UTENTE"
$ 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)"
Then:
chkconfig --level 345 vncserver on
# The VNCSERVERS variable is a list
of display:user pairs.
-----------------------------------------------------------------------------------
-------------------------------------------------------------
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
--------------------
VNCSERVERS="3:leopard"
VNCSERVERARGS[3]="-geometry 1024x768 -depth 16"
User Configuration
------------------------
# 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.
After the initial configuration is done we restart the vnc service. As root:
# chkconfig vncserver on
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.
- 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.
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:
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
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
* -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.
Using SSH tunnels to conect to your VNC server has two advantages:
---------------------------------------------------------
Further Reading
-------------
# 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
Section "Module"
...
Load "vnc"
EndSection
Section "Screen"
...
Option "SecurityTypes" "None"
EndSection
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.
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.
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.
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).
If you haven’t set the vnc password, use “vncpasswd” to set it first.
Then set up a vncserver:
vncserver
vncviewer localhost:1111
Now enjoy it ;)
After finished using this desktop, remember to close is on the server side:
vncserver -kill :1
--------------------------------------------------------------------------------
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.
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.
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.
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.
Edit the /etc/sysconfig/vncservers file and add the -localhost option to the
VNCSERVERARGS line, so that it reads:
This option tells the VNC server not to accept remote connections from VNC
clients without a secure tunnel.
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.
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"
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.
VNCSERVERS="2:clyde 3:clyde"
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.
You should see output from all instances being started, such as:
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.
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)
[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.
Password:
Verify:
xauth: file /home/raj/.Xauthority does not exist
systemctl daemon-reload
Start the VNC service.
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.
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)
================================================================================
The init method works for RHEL and it's clones (Oracle Linux and CentOS) up to and
including RHEL6.
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.
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
# systemctl daemon-reload
Set the VNC password for the user defined in the new configuration file.
# su - oracle
$ vncpasswd
Password:
Verify:
$ exit
logout
#
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.
--------------------------------------------------------------------------------
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
Follow up:
Many things have changed since I last delved into this back in Fedora 8.
- chkconfig only controls sysv based services - not systemd. Instead use systemctl
with no arguments
Details:
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)
# cp /lib/systemd/system/[email protected]
/etc/systemd/system/vncserver@:1.service
# cp /lib/systemd/system/[email protected]
/etc/systemd/system/vncserver@:2.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
Log in as each user and execute the command vncpasswd for each account.
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)
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
__________________________________
In you VNC client software, it will ask for a hostname or IP address, then a
Display number and password
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.
---------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-------------------------------------------------------------
Fedora 17 - VNC server setup
-----------------------------------------------------------------------------------
-------------------------------------------------------------
Follow up:
Many things have changed since I last delved into this back in Fedora 8.
- chkconfig only controls sysv based services - not systemd. Instead use systemctl
with no arguments
Details:
# cp /lib/systemd/system/[email protected]
/etc/systemd/system/vncserver@:1.service
# cp /lib/systemd/system/[email protected]
/etc/systemd/system/vncserver@:2.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
Log in as each user and execute the command vncpasswd for each account.
This will crfeate a .vnc folder in each user's home directory and it stores the
hashed password
in there.
you will see a reference to port 5900, then sequential ports upwards from there to
specify your
individual user's entry points
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
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.
------------------
Created symlink
/etc/systemd/system/multi-user.target.wants/vncserver-x11-serviced.service
→ /lib/systemd/system/vncserver-x11-
serviced.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.
Requirements
---------------------
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.
VNC Server parameters can be specified in the following new configuration files:
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
--------------------
/etc/vnc/config
/etc/vnc/config.custom
~/.vnc/config (ignored if the -config flag is used, below)
Xorg configuration
-----------------------------
/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
-------------
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.
==================================================================================
REMOVE GNOME
==================================================================================
https://raspberrytips.com/pimp-my-raspberry-pi/
==================================================================================
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
#!/bin/sh
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:
nano .vnc/xstartup
Edited file:
#!/bin/sh
#!/bin/sh
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &
================================================================================
IMPLEMENTAZIONE
================================================================================
x11-common.service
Loaded: masked (/dev/null; bad)
Active: inactive (dead)
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.
file /lib/systemd/system/x11-common.service
it should return:
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 daemon-reload
and check status once more
-----------------------------------------------------------------------------------
-------------------------------------------------------------
/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
Lanciando:
vncserver :1 -geometry 1280x720 -depth 24
Viene lanciato:
/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
vncagent
vncagent-raspi
vncinitconfig
vnclicense
vnclicensewiz
vncpamhelper
vncpasswd
vncserverui
vncserver-virtual
vncserver-x11
vncserver-x11-core
vncserver-x11-serviced
vncviewer
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