Ubuntu 11.04 classic and separate x sessions

Forgive me regular readers, it has been almost 3 months since my last diary post. As usual I have many excuses (lots of work, fair amount of DIY, and two holidays), but for once I have a lot to say, so I'll try to get writing real entries soon. For now though: I'm alive, and stay tuned for my next entry, which should be here in a day or so and will most likely be about cats.

Now for a public service announcement. Here's a helpful hint for the two other people in the world who use Ubuntu with an nvidia card and multiple monitors, but who have failed to get separate x sessions on 11.04 working.

Short version: restart compiz.

Update: this will apparently not help if you use Unity, so it only applies for Ubuntu classic mode.

I use two screens, and prefer separate x sessions to twinview, because the latter is pretty poor. It has always worked well in Ubuntu, but with the upgrade to Natty Narwhal my second screen stopped working properly.

Those of you who follow me on twitter will no doubt remember me complaining about Unity. I tried it when it first appeared in their netbook edition, and disabled it thinking it was a bad joke, so was astounded to find that in 11.04 canonical resolved none of the issues, but had somehow managed to find a way to make it worse, yet think it was good enough to be the default. I lasted 40 seconds before I switched to Ubuntu Classic, but in that time I did notice that windows on my second screen had no title bars. More Unity bugs, I assumed.

However, under Ubuntu Classic, windows in my separate x session still had no title bars or other window chrome, and weren't even focus-able. Second screen was completely useless. It did work if I restarted in "Ubuntu Classic no effects" mode, but that had various issues, not least forgetting to redraw half the screen.

After putting up with it for a couple of months, I finally gave up. Here's what to do to get the separate x session working under 11.04:

  1. Create a script: vi fix_crappy_narwhal.sh
  2. Put this in it:
    #!/bin/bash
    # After upgrading to Ubuntu 11.04, compiz fails to initialise the second screen
    # This should sort it out
    DISPLAY=:0.0 compiz --replace ccp &
    DISPLAY=:0.1 compiz --replace ccp &
    
  3. Save and quit
  4. Make sure it's executable:
    chmod 755 fix_crappy_narwhal.sh
  5. Run it manually this time:
    ./fix_crappy_narwhal.sh
  6. Add it to System -> Preferences -> Startup Applications for next time

Hopefully that's helpful to someone between now and October when Shuttleworth forces Unity on us in 11.10.

Comments

robert florijn

hello,

after configuring nvidia-xconfig as separate x, my second screen will just show the wallpaper and no toolbars. After running your script, on my #1 monitor the toolbars disapear and the #2nd monitor still shows only the background. This is in unity. I think we have to wait for the ubuntu update and I hope it coms fast... but thx anyway.

Robert

Ahh, yes, unity. I'm afraid I can't help with that - I despise it intensely! Mostly because of reasons like this - it's such a half-based steaming pile of bugs that means it can't handle basic requirements the linux world sorted out years ago.

Canonical have proven time and time again that they don't care about power users like us - it seems that Shuttleworth has decided to target the mass netbooks/tablets/laptops market, and seem to ignore suggestions and complaints about anything unrelated to furthering that goal. Yes, it's open source so I could fix it if I wanted, but I don't have the considerable amount of time it would require to figure out how to do so.

My suggestion for the time being would be to switch to ubuntu classic, then consider a different distro in October when classic mode is removed. If gnome 3 isn't a goer on ubuntu, I'll either be trying xubuntu or ubuntu with awesome wm, of which I have heard only good things.

xv22

Thanks for the hints. Have the same problems for month, and can't fix it. Please note that Gnome3 is also totally crapped and doesn't even load with two separate X screens. The developers say in Bugzilla that nobody needs this and you have to stick with TwinView (which causes ugly tearing in videos for me and makes XBMC unusable)

Ah, what a farce. I'm still running 11.04 so I can at least have this half-broken system. I'm trying out lubuntu and xubuntu, but think I may end up giving up with those and making the switch to awesome - I hear that has fantastic multi-monitor support.

Leave a comment