My Quest to Fix Compiz and VNC in Fedora (Wednesday, October 22, 2008 7:52:00 PM)
divider

Lately I've been getting a little bored with Windows, so I figured I'd delve into Fedora 9 a little bit more.  I mean, hey, why not?  It's not a great OS (I can't do everything I can do in Windows), but it's solid enough. 



For me to consider the OS an "every day" kind of choice, it needs to do 3 things very well: handle my email, create office documents, and allow me to remote into it to check websites that are blocked at work :)  That third one (arguably the most important one) was running into a problem: VNC wasn't displaying windows properly.  I didn't have a title bar, window controls, or anything that would allow me to move the window around.

I started this thread in the Fedora forum to see if anyone had seen anything like this. 

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

To my surprise, the thread never got a response in it's 7 days + of existence.  I quickly concluded that I was on my own in this one.  It was time to dissect the problem further ...

My hunch was that the strange state of the X windows had something to do with how I was starting the session in the xstartup file (/home/username/.vnc/xstartup).  Here's how it looked initially:



#!/bin/sh

# Uncomment the following two lines for normal desktop:
exec /etc/X11/xinit/xinitrc
unset SESSION_MANAGER

[ -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" &
gnome-session&




Looking at the log after starting the vncserver, I noticed a problem:

(gtk-window-decorator:3560): Gdk-WARNING **: Using Cairo rendering requires the drawable argument to
have a specified colormap. All windows have a colormap,
however, pixmaps only have colormap by default if they
were created with a non-NULL window argument. Otherwise
a colormap must be set on them with gdk_drawable_set_colormap

(gtk-window-decorator:3560): Gdk-CRITICAL **: gdk_cairo_create: assertion `GDK_IS_DRAWABLE (drawable)' failed
compiz (core) - Fatal: No composite extension


So, what does this mean?  Like I eventually concluded in the fedoraforum thread, I never knew that Gnome was a desktop rather than a window manager.  I had never understood the distinction.  Apparently my entire problem was just that I had no window manager running.  And what's compiz, you ask?  It's the window manager when Gnome uses desktop effects.  Apparently it enables transparency and all sorts of other extras.

Unfortunately, when I tried to start compiz in my VNC session, it gave an error of "Fatal: No composite extension."  What this means, I still don't know, but I'm guessing that I'm unable to start a compiz session while in VNC.  So, what's a guy to do now?

It turns out that if you don't use compiz and desktop effects for your window manager, Gnome uses something called Metacity instead.  I simply added the line "metacity&" at the end of my xstartup.  Voila! It worked!  I have borders, title bars, and window controls again.  I guess the only problem is that avant-window-manager doesn't run without compiz, but you win some and you lose some.

Here's what my xstartup file looks like now:


#!/bin/sh

# Uncomment the following two lines for normal desktop:
#exec /etc/X11/xinit/xinitrc
#unset SESSION_MANAGER

[ -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" &
gnome-session&
metacity&




The final thought I have about this revolves around what happens when I VNC to display :0 (the display of console login).  I do see avant-window-manager and compiz  is working.  How can this be?  Is compiz just not capable of starting while under VNC, but you can enter an existing session with it running?  I don't know.  All I know is that I can't get compiz running under any fresh X session over VNC.

Feel free to share any of your thoughts on this issue ...


-Newman




 Commentsdivider

- Posted by "Kevin" on Wednesday, April 01, 2009 11:04 AM
Oh but it does ... that's the strange part. I've come to a few more conclusions since writing this post. Mainly, now I CAN connect to a Compiz session over VNC, but only if it's on display:0. I think vino-server does this. I was originally having a problem changing the default listening port on display 0, but I've since tunneled through SSH on 22, so that's not a big deal anymore. So anyways, my point here is that YES, Compiz can work over VNC, but you've got to be using vino-server on display 0.
- Posted by "NK" on Wednesday, April 01, 2009 10:36 AM
Compiz isn't going to work under VNC since all those fancy effects are handled by your graphics card. It's not like you can transport all that rendered stuff over VNC.


Enter a New Comment Below

Subject:

Enter Your Name (Required):


Enter your comments about this blog entry:



   












Other Interesting Shit...
line break

NewmanCam

NewmanCam Pic 

 

Where am I at Right Now?

Since I've been sort of nomadic lately, now you can look at this little widget dealie and see where I'm at and what the weather is there. Nifty, eh?