Run your virtual OS directly from GDM in Ubuntu

October 14, 2008

If you regularly run a couple of OS from your VirtualBox and want to login to those OS directly from GDM session, here is a quick way to do it. For this to work you should have already set up your VirtualBox. Here we won’t be talking about how to setup VirtualBox but only how to login to a virtual OS from GDM session.

Windows XP GDM

Windows XP GDM
  1. Create a bash script with the following contents

[ad]

#!/bin/bash VirtualBox -startvm **_NameOfYourVirtualOS_**

Replace yourSUPassword with your password, and NameOfYourVirtualOS with the name that you have given to your virtual OS in VirtualBox.

  1. Name it something like windowsXPGDM (if you want to run Windows XP), make it executable, and then copy it to /usr/bin.

$ chmod 755 windowsXPGDM $ sudo cp windowsXPGDM /usr/bin

  1. Go to /usr/share/xsessions and create a new file with the following contents:

[Desktop Entry] Encoding=UTF-8 Name=WindowsXP Comment=My Virtual WindowsXP Exec=/usr/bin/windowsXPGDM Icon= Type=Application

  1. Save it with a name something like windowsXP.desktop.

  2. Log out and you will see a new entry WindowsXP in your GDM session. You can now directly open VirtualBox session without even logging in to your Ubuntu machine.

[ad]

Discussion, links, and tweets

By day, I ship code at MetaGeek, by night, I hack on my personal projects, and finally, when I get some off time in between, I also serve as a CTO for ClockworkEngine, LLC where so far we have launched two products - Spyglass and LightPaper. Call be a serial coder if you want.