At first I answered this question to match Lucasmus' situation where he actually had been able to restore the ability to boot already, and had a working grub from a (non-wubi Ubuntu install) on his MBR. Since most people coming here are probably not in that situation, but just getting the grub rescue shell at boot and can't boot Windows or their Wubi install at all, I've remade the instructions for the normal case. The answer for Lucasmus's question was basically to follow what's now steps 2 through 5 below.
This is unfortunately a known bug in Wubi https://bugs.launchpad.net/bugs/610898. I've submitted a patch to hopefully prevent future users from having Wubi render their drive completely unbootable but until that or another fix is accepted this is what you need to do (in Wubi) to get Windows and Ubuntu booting and prevent this from happening again:
1: Boot from an Ubuntu LiveCD and run sudo software-properties-gtk -e universe && sudo apt-get update && sudo apt-get install mbr && sudo install-mbr /dev/sda
.
If you have more than one hard drive you will need to change /dev/sda
in that last command to the drive windows is on. But it will always be a drive, never a partition. So /dev/sdb
might be appropriate but never /dev/sdb1
(doing the latter could overwrite Window's PBR making it even harder to boot back into windows).
Now you should be able to boot into Windows or your Wubi install like before. If you want to continue using Wubi then follow the next steps to be sure that you don't get into an unbootable situation again.
2: Boot into your Wubi install and run sudo dpkg-reconfigure grub-pc
This will bring up some dialogs with questions.
3: For the first question The following Linux command line was extracted from /etc/default/grub or the 'kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is correct, and modify it if necessary.
Leave the field at its default (probably blank) and press enter to continue to the next question.
4: For the second question The following string will be used as Linux parameters for the default menu entry but not for the recovery mode.
again leave it at the default (probably "quiet splash") and press enter to continue
5: This question ...GRUB install devices:
is the important one. Make sure that you uncheck everything but /dev/loop0
. You can check/uncheck an entry with the space bar, and change entries with the arrow keys.
If you press enter before unchecking /dev/sda from this list your computer will become unbootable again.
Now you can safely update/upgrade your Wubi install without worrying about your computer becoming unbootable.
I found a page that might be just the thing for you.....
https://wiki.ubuntu.com/X/Config/Resolution
Relevant section:
Adding undetected resolutions
Due to buggy hardware or drivers, your monitor's correct resolutions may not always be detected. For example, the EDID data block queried from your monitor may be incorrect.
If the mode already exists, but just isn't associated for the particular output, you can add it like this:
xrandr --addmode S-video 800x600
If the mode doesn't yet exist, you'll need to create it first by specifying a modeline:
xrandr --newmode <Mode``Line>
You may create a modeline using the gtf or cvt utility. For example, if you want to add a mode with resolution 800x600 at 60 Hz, you can enter the following command: (The output is shown following.)
cvt 800 600 60
# 800x600 59.86 Hz (CVT 0.48M3) hsync: 37.35 kHz; pclk: 38.25 MHz
Modeline "800x600_60.00" 38.25 800 832 912 1024 600 603 607 624 -hsync +vsync
Then copy the information after the word "Modeline" into the xrandr command:
xrandr --newmode "800x600_60.00" 38.25 800 832 912 1024 600 603 607 624 -hsync +vsync
After the mode is entered, it needs to be added to the output using the --addmode command as explained above.
Best Answer
You can create a new xorg.conf by switching into a virtual virtual console (Ctrl + Alt + (F1-F6)) and running
sudo service gdm stop
.Then run
Xorg -configure
(yes, it should beXorg
, notxorg
). If you had an old xorg.conf file in /etc/X11/ you'd first back that up by doingsudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
.Then move your newly created xorg.conf to /etc/X11/ by running
sudo mv xorg.conf.new /etc/X11/xorg.conf
and restart gdm by runningsudo service gdm start
.Then you can change the color depth in there by finding the appropriate section and changing/adding whatever's in there to
DefaultDepth 16