Find the answer to your Linux question:
Results 1 to 5 of 5
Hello, I have several VM's install on my system that I would like to configure in my grub so that I might be able to boot to them directly on ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677

    Booting VM's directly


    Hello,

    I have several VM's install on my system that I would like to configure in my grub so that I might be able to boot to them directly on system startup.

    My VM's use actual disk space and not VM files so I believe this would be possible but I am unsure as to how to go about setting up grub to boot them.

    Here is the trick I am running raid 1 here and here is what it looks like

    Code:
    cat /proc/mdstat
    Personalities : [raid1]
    md0 : active raid1 sdb1[1] sda1[0]
          513984 blocks [2/2] [UU]
    
    md10 : active raid1 sdb6[1] sda6[0]
          204796480 blocks [2/2] [UU]
    
    md8 : active raid1 sdd1[1] sdc1[0]
          204796480 blocks [2/2] [UU]
    
    md9 : active raid1 sdd2[1] sdc2[0]
          204796544 blocks [2/2] [UU]
    
    md5 : active raid1 sdd6[1] sdc6[0]
          157573440 blocks [2/2] [UU]
    They are configure as follows:
    Code:
    md5    sdc6    sdd6    VM    Kubuntu
    md8    sdc1    sdd1    VM    Peppermint
    md9    sdc2    sdd2    VM    Ultimate
    md10    sda6    sdb6    VM    Centoos 6

    Grub looks like this:
    Code:
    # grub.conf generated by anaconda
    #
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE:  You have a /boot partition.  This means that
    #          all kernel and initrd paths are relative to /boot/, eg.
    #          root (hd0,0)
    #          kernel /vmlinuz-version ro root=/dev/md1
    #          initrd /initrd-version.img
    #boot=/dev/md0
    default=0
    timeout=5
    splashimage=(hd0,0)/grub/splash.xpm.gz
    hiddenmenu
    title CentOS (2.6.18-274.3.1.el5)
            root (hd0,0)
            kernel /vmlinuz-2.6.18-274.3.1.el5 ro root=/dev/md1 vga=795 rhgb quiet
            initrd /initrd-2.6.18-274.3.1.el5.img
    title CentOS (2.6.18-274.el5)
            root (hd0,0)
            kernel /vmlinuz-2.6.18-274.el5 ro root=/dev/md1 vga=795 rhgb quiet
            initrd /initrd-2.6.18-274.el5.img
    title CentOS (2.6.18-238.19.1.el5)
            root (hd0,0)
            kernel /vmlinuz-2.6.18-238.19.1.el5 ro root=/dev/md1 vga=795 rhgb quiet
            initrd /initrd-2.6.18-238.19.1.el5.img

    I would like to add each of these to grub so that I can boot into anyone of them. How would I go about this?

    Thanks for you time.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  2. #2
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,042
    I doubt you will be able to do this, I'm not sure which VM manager you are using but for VirtualBox I think the host OS has to run to provide the environment for the VM guest see here.
    At one point I was trying to work out how to run a VM without an X session, but because I was accessing the VM on the same host I didn't get very far with it. I think you need a hypervisor which will run on the host ...

    ... I suspect you know much more on the subject than I do ... I'll watch this thread with interest ...

  3. #3
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    I am sure I should be able to do this. The host OS is CentOS and using KVM. Each VM has it's own install on a RAID disk and is install as such. I should be able to boot them like you would a windows or any other OS that you have installed on a separate partition. I just haven't figured out grub side of things to get this setup.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  4. #4
    Linux User hatebreed's Avatar
    Join Date
    May 2010
    Posts
    335
    what format are the partitions in? You would have to make sure that grub would recognize them as a normal partition and not something exotic.

  5. #5
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    They are normal partitions on the drives, not files. This is one of the reason why I choose drive over files. The other was if something goes wrong I can mount the partition and fix it. I believe grub should be able to recognize them as they are ext3 format. Does grub recognize ext4 partitions? I think it does. I tried a few things and they didn't work so I placed this onto the back burner as I am presently focused on GNS3.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •