Tuesday, February 21, 2012

Give spice a try - or: Smooth VNC.

Spices - 50mm with macro converter f/3.2
Who doesn't know it: You are controlling your laptop via VNC, but all youtube videos scrolling through windows seems to be sluggish and parts of the window don't get updated - you see black patches everywhere.
Being in such a situation I wanted to try spice.

On Fedora 16 there is a spice Xserver where you can launch any program like you are used to do. So how does this help to improve the situation? Well, spice has an highly optimized protocol to deliver data from a server to a client e.g. it detectes videos played fast moving content on the server side, which are transmitted using mjpeg (AFAIK).
Anyhow, here we go (on the server side):
$ export CLIENT_ADDR=cut-n-paste
$ sudo yum install --enablerepo=updates-testing \
$ sudo iptables -I INPUT -s $CLIENT_ADDR -j ACCEPT
$ Xspice --port 59007 --disable-ticketing :1.0 & 
$ { sleep 2 ; \
    export DISPLAY=:1.0 ; \
    metacity & \
    gnome-terminal ; }
This launches an Xspice server, listening on port 59007 and starts a metacity and gnome-terminal instance after 2 seconds within that server. The first line opens the appropriate ports.
Afterwards fetch spicec, the spice client (something like remmina, oh, has remmina already a spice plugin?) and connect it to the server:
$ export SERVER_ADDR=cut-n-paste
$ sudo yum install --enablerepo=updates-testing \
$ spicec -h $SERVER_ADDR -p 59007
A nice thing about spice is, that it's an xserver, so you can use xrandr to change the resolution at runtime. Nice.
$ xrand -s 1680x1050
$ firefox
# or, to connect to your original desktop via 
# VNC, but to transmit the desktop via spice 
# to your client. yey.
$ vncviewer localhost
Maybe this helps some lost soul to get a saner my-remote-desktop-over-a-network experience.
A last thing: Does someone know how to tell Fedora what X server to start on boot?

No comments:

Post a Comment