如何在Fedora 20 KDE 上用使用x11vnc起VNC SERVER共享当前服务器屏幕

http://forums.fedoraforum.org/showthread.php?t=299446


If you want to start x11vnc at boot-up in Fedora 20, follow these steps. I used information at

https://bbs.archlinux.org/viewtopic.php?id=168756

as a basis for this guide.

IMPORTANT: If you cannot afford to loose your data, create a backup.
If things don't go well, you may not be able to boot at all or you may end up in the recovery shell.

You can always practice these steps using a Fedora 20 Virtual Machine before doing anything on production machines.


1. Use Software from the GUI or Yum to install x11vnc. If the firewall is active (by default it is), open the vnc port (5900). Then, manually start x11vnc and verify that it works. You can test x11vnc by going to Activities in the GUI and type in x11VNC Server. The GUI will open and allow you to start the service.

There are other posts available to help you with installing x11vnc and opening a firewall port. For me this was very straight forward and it just worked.

2. In Terminal, CD to /etc/systemd/system.

3. Perform the editing of files as root (sudo).

4. Use gedit to create /etc/systemd/system/x11vnc.service. Copy the following text into the new file.


set password for x11vnc login:

   

$ 
$ x11vnc -storepasswd password /etc/x11vnc.pass

Code:
[Unit]
Description=VNC Server for X11
Requires=graphical.target
After=graphical.target

[Service]
Type=forking
ExecStart=/usr/bin/x11vnc -rfbauth /etc/x11vnc.pass -rfbport 5900 -display :0 -auth /var/run/lxdm/lxdm-\:0.auth \
 -forever -bg -o /var/log/x11vnc.log -xkb -noxrecord -noxfixes -noxdamage -nomodtweak

[Install]
WantedBy=multi-user.target
In ExecStart line I removed the -rfbauth parameter and path to the pass file but it should ideally be used.

In the ExecStart line I also set -allow to the first three segments of my network's IPv4 address, meaning clients on the same network are allowed to connect.

5. Save the file.

6. Use gedit to create /etc/systemd/system/graphical.target. Copy the following text into the new file.

Code:
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Graphical Interface
Documentation=man:systemd.special(7)
Requires=multi-user.target
After=multi-user.target
Conflicts=rescue.target
Wants=display-manager.service
Wants=x11vnc.service
AllowIsolate=yes

[Install]
Alias=default.target
7. Save the file.

8. Perform

Code:
sudo systemctl disable graphical.target
This command will delete default.target file. That is OK.

9. Perform

Code:
sudo systemctl enable graphical.target
The command will rebuilt default.target.

9. Perform the following command to restart the daemons This will perform the actions that occur at boot-up (items 9 and 10 may be in reverse order but that's how I received them):

Code:
sudo systemctl daemon-reload
10. Perform the following command to enable x11vnc to start at boot:

Code:
sudo systemctl enable x11vnc
11. Manually start x11vnc to make sure the daemon has started it, too. When the GUI opens it will default to port 5901 if the daemon has also started an instance at port 5900.

12. If all is working to this point, reboot and see if x11vnc starts at boot by performing the previous step again.

There are currently no troubleshooting tips.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值