一半君的总结纸

听话只听一半君

在fedora 19上安装tigervnc server(但是启动后即自动退出?)

照常安装,此时yum上的版本是 tigervnc-server.x86_64           1.2.80-0.16.20130314svn5065.fc19

https://ask.fedoraproject.org/question/7433/vnc-setup-fedora-17/

# Quick HowTo:
# 1. Copy /lib/systemd/system/vncserver@.service to /etc/systemd/system/vncserver@:*.service
# 2. Edit <user> and vncserver parameters appropriately
# ("runuser -l <user> -c /usr/bin/vncserver %i -arg1 -arg2")
# 3. Run 
# 4. Run systemctl enable vncserver@:<display>*.service
# 5. Run systemctl start vncserver@:<display>*.service

ps: * 是个数字
但是发现启动后马上自动退出
错误如下

XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":1"
after 141 requests (141 known processed) with 0 events remaining.
...

解决方法在这里

The problem appears to be the detection of the Xvnc process / PID; systemd isn't picking it up and thinks the service has died, so it launches the ExecStop script almost immediately after vncserver (ExecStart) completes.

I was able to work around the problem by manually directing systemd to the Xvnc PID file in my homedir. The following line added to the /etc/systemd/system/vncserver@:1.service unit file Works For Me(TM):

PIDFile=/home/.vnc/%H%i.pid

bugzilla

Edit: 安装后使用中发现 如果kde resume session开着的话(默认是开的)dropbox图标经常不出现,firefox总是说已经running,必须先终止已有的才能开新的,结果只好在进程里把他关掉 解决方法是 vnc不要用平时用的用户 专门给他自己建一个用户

ps: 后来用的时候发现默认分辨率太大,公司用来遥控家里机器的屏幕分辨率比较小,这时候可以把/etc/systemd/system/vncserver@:.service里的

ExecStart=/sbin/runuser -l <username> -c "/usr/bin/vncserver %i"
改成
ExecStart=/sbin/runuser -l <username> -c "/usr/bin/vncserver %i -geometry 1600x1200"

之前好像是1920*xxx,太大了,万一你用的是gnome3不是kde有可能这样还是不行,也许是因为vnc设了过后,进gnome的时候gnome自己又设了分辨率,这时候也许可以运行

xrandr -s 1600x1200

这个应该也可以加在上面的配置文件里的把,没试怎么加,因为我第一步改过就生效了,我用的是kde

edit: 如果想像windows一样,可以直接连到已登录用户的桌面,可以用x11vnc,或者
Using TigerVNC’s x0vncserver (Recommended)
TigerVNC provides the x0vncserver binary which has similar functionality to x11vnc e.g.

x0vncserver -display :0 -passwordfile ~/.vnc/passwd

抄袭自这里

ps: 如果想用 xrandr 动态的切换分辨率,可以
在上面的命令行里加入 -randr 1280×800,1600×1200 等等(假设vncserver支持xrandr,见这里)

[fucker@localhost ~]$ xrandr
Screen 0: minimum 32 x 32, current 1024 x 768, maximum 32768 x 32768
VNC-0 connected 1024x768+0+0 0mm x 0mm
   1920x1200      60.0  
   1920x1080      60.0  
   1600x1200      60.0  
   1680x1050      60.0  
   1400x1050      60.0  
   1360x768       60.0  
   1280x1024      60.0  
   1280x960       60.0  
   1280x800       60.0  
   1280x720       60.0  
   1024x768       60.0* 
   800x600        60.0  
   640x480        60.0  
[fucker@localhost ~]$ xrandr -s 1280x800

但是发现firefox的菜单和tab字很小,可以 Enter “about:config” in the address bar, type in “dpi” in the search field, and change the one value that comes up from “-1” to “0”. Restart Firefox and the problem is solved.

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: