Putting a virtual machine on a partition thus being able to boot into it.
Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Putting a virtual machine on a partition thus being able to boot into it.
I asked /g/ (4chan) if it was possible to take a Linux virtual machine and somehow put it on a partition and booting it, instead of running it as a virtual machine.
Some said it was possible and I was given a rundown of what needed to be done, however I don't know how to do most of it (although I understood it)
I was told to "cp -a" everything to a partition with a compatible filesystem and add an entry in the grub.
Regardless of what /g/ said, can anyone give me some info on how I would go about doing this?
I asked /g/ (4chan) if it was possible to take a .. virtual machine and somehow put it on a partition and booting it, instead of running it as a virtual machine.
A virtual machine is (for this discussion) a real computer with a real file system. Any method that can be used on a real computer can be used on a VM. People tend to use dd or other clone apps to do what. You have to understand that the VM also has the entire hard drive not just a partition so you'd have to adapt the partition to be booted by your bootloader or chain it over.
So what method would you use to clone or copy a partition to a partition?
Well I have no clue on how to do it or even if it is possible but if it is, I would love to give it a try.
I was told I could only do this if the guest operative system was a Linux system, then it could work but if the guest operating system was Windows it wouldn't.
I was told to "cp -a" everything to a partition with a compatible filesystem and add an entry in the grub.
This statement leads me to believe that one is trying to copy a partition. I would not use cp myself but it can be done.
I still offer this statement. Almost any virtual machine can be cloned or copied just like any real partition. Then it could be in most cases booted to the new hardware. This makes some assumptions too. That the OS either doesn't care about new hardware or it can be repaired somehow. One can not take a sparc VM and try to run it on a x86 for example.
Slackware can be the DomU running directly under the Hypervisor.
And, of course, Slackware can be a bare metal install (the PC boots and runs Slackware).
The same can be true of pretty much any distro.
But I can't believe the *SAME* install can be used in all three roles. It might happen to be Slackware (or SuSE, or Debian) ... but it's a *different* install and a *different* configuration for each of the three roles.
Slackware can be the DomU running directly under the Hypervisor.
And, of course, Slackware can be a bare metal install (the PC boots and runs Slackware).
The same can be true of pretty much any distro.
But I can't believe the *SAME* install can be used in all three roles. It might happen to be Slackware (or SuSE, or Debian) ... but it's a *different* install and a *different* configuration for each of the three roles.
Isn't it?
Nope - the exact same install. There's really only two roles - one as bare metal install and the other as domU under Xen. One Linux installation can function in both environments. Possibly a couple of small changes to be made to kernel and fstab and that's it.
For example:
1) Install Xen hypervisor with NetBSD dom0;
2) install Slackware/Scientific Linux/Debian as normal, on bare metal, completely apart from Xen, on separate partitions or in logical volumes;
3) make sure kernel in Slack/Debian etc. is compiled with Xen domU options and also change /etc/fstab values to UUIDS so the system boots in both environments; Debian and Scientific Linux have the kernel options enabled by default so no change necessary there, and SL has UUIDs in fstab so no change needed there either;
4) boot into Xen and start one or all of these Linux distros as domUs, using XDMCP to bring up full-speed desktop;
5) alternatively, boot normally again and select one but only one of these Linux installations to run as bare-metal install, completely outside XEN.
I now have Scientific Linux and Debian doing the same as Slack. To my mind it's the best kind of virtualisation: it allows me to run the same installation virtualised or natively. The only thing I don't have working yet in domU is audio forwarding to dom0. Otherwise everything is perfect, with minimum fuss and configuration.
Last edited by Gerard Lally; 05-03-2011 at 06:51 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.