Howto change GRUB default entry to use with VMWARE without restart?
Hi everyone,
I'm using vmware workstation under suse to boot into xp installed on another partition (i wish wasn't;)) I was trying to come up with a script that would change the grub default entry for the time vmware is run. That didn't work out very well. As I understand grub writes something to boot sector during the shut down, and that's when the changes come into place. Is there a way to do this on the fly without rebooting? thanks in advance george |
I think u r talking two different things...
If you just need to change default OS boot, you just need to change "default=" in grub.conf and nothing else.... It doesnt have anything to do with shutdown and all tht |
Do you mean you want vmware to start after a certain amount of time is passed or at a scheduled interval (ex: load XP under vmware at (9:00pm)? If so you'd probably want to use cron to do so. If not, could you re-phrase what you want to do?
|
Quote:
Just to make it clear, the virtual machine boots off the physical drive even thought under a host OS. So it is possible to boot into WinXP natively. Quote:
Code:
cat /boot/grub/menu.lst Code:
cat /usr/local/bin/xp By the end of the third line, menu.lst does have 3 as the default entry which is the windows xp entry. However when vmware runs and shows my grub menu, the highlighted option is still suse and I have to manually choose the xp entry. Not a big deal, it just feels good when everything is automated ;) |
hmm well I think you are confusing real bios and partitions to virtual?
if xp is on an emulated partition visible to vmware...then grub can boot it under emulation and you change the emulated grub file if you have one, to reflect your preferences. but it is not clear to me, that the grub menu file you have posted is a real or not. So me ask a couple of questions and maybe you can see how to reply. 1) You have a suse install and a suse grub file. I want to boot directly from suse into a vmware xp? yes setup vmware load xp as an emulation, choose your bootloader etc if dual booted emulation. 2) I have a suse host with vmware and I want to boot into a real partition that is xp? News to me that you can do it without a reboot. please tell me how you are doing it. 3) I am not sure what I want....what are my options in the current mindset? a) get rid of linux...install xp for real...download an emulator (or whatever) run linux from that application b) get rid of ms....install linux for real...download an emulator (or whatever) run ms from that application c) keep my xp and linux partitions but I want to play with linux...install more virtual linux systems then I do not use vmware so I may be wrong on what you can already achieve I use virtualbox. Feel free to correct me on all of my mistakes |
Quote:
I only need windows for that work that has to be done in AVRStudio (wine's no good here). There are plenty of tools for linux to code for atmel's boards but it's just easier to communicate with other people in the team if i use the same software. I'm from UniNSW btw, that's for one of the courses) So when vmware starts its virtual machine it does look at my real grub (or at least it shoud). If I let it go over the timeout it will even try to boot the same kernel I'm running at the moment. Usually the host OS just freezes, and it is not recommended anyway. So the question is still the same: why suse needs to reboot before vmware would recognise the changes to grub's menu.lst? |
Ah OK, I think I have deciphered what you're trying to say! Let me know if this is correct.
Is this remotely right? Did I get some of the points correct? If not please re-re-phrase. I don't think we're even understanding the information let alone the problem yet. :-) |
Quote:
1. Say I have 4 entries in grub: 0-suse default 1-suse failsafe 2-suse realtime (current default) - my usual kernel 3-windows 2. Say I go to edit menu.lst so that it says "default 3" as if it was pointing to windows entry. 3. Now, if i run vmware and start my virtual machine it will show my normal grub screen but it will still have entry 2 (suse realtime, my usual kernel) chosen by default. That is wierd coz i just manually changed it to 3 (windows) in step 2 above. 4. If I shut the virtual machine down, AND reboot the real machine, grub's default entry does become 3 (windows)!! Both in the real machine and in vmware. As you see the change i made in step 2 does not apply until i reboot the real machine. This is not really a problem, but rather a challenge to find out why it is so. It's not hard to hit a button during the VM boot anyway, but I just need to execute another command before vmware starts (related to direct disk write permissions as you mentioned), so why not put everything in a script. |
ok it may be hardware issue?
VMware Workstation supports using raw disk partitions only on IDE drives. Booting guest operating systems on raw SCSI drives is experimental. However, if a virtual machine is configured with a virtual disk, instead of a raw disk partition, then its disk (file) can be stored on the Linux file system, regardless of whether the underlying drive(s) containing the file system are IDE or SCSI. source http://www.vmware.com/support/refere...ces_linux.html More info on vmware http://www.vmware.com/support/refere...sks_linux.html 2) It may be a permissions issue? http://www.vmware.com/support/refere...ces_linux.html I think I understand what you are doing, but I use vbox so have no wish to load another emulator good luck |
I know VMWare has a option to take snapshots so that any changes are put into a so called cache until you shutdown VMWare when it gets written back to disk. It's purely speculative, but it might be caused by that. I wonder if running VMWare as its own user that doesn't have permission to the /boot/ folder would fix the issue.
|
Quote:
chmod g+w /dev/sda1 chmod g+w /dev/sda2 chmod g+w /dev/sda3 chmod g+w /dev/sda4 (all the partitions i have) will make vmware return Quote:
Must have write permissions to the whole disk chmod g+w /dev/sda Same if I chose to only use /dev/sda3 (my windows partition) when setting up vmware. But this time it will make GRUB go into error 17. I checked out some threads on other forums, the only solution is to choose the whole disk in vmware, as I was using it before. So no way to check its behavior without giving permissions. |
What I met was, give VMWare permission to use the Window's partition (it obviously will need it to run Windows), BUT only give VMWare read/write permissions to it's folder: '/home/grol/vmware/', and only read permission for the rest of the Linux root.
Since /boot/ is located on your Linux root partition, VMWare shouldn't be able to muck around with grub, but should be able to touch it's configuration and read the files that the MBR points to... but not change them in anyway. |
All times are GMT -5. The time now is 09:55 AM. |