LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This 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


Reply
  Search this Thread
Old 04-22-2011, 12:49 PM   #1
blacksiddis
LQ Newbie
 
Registered: Mar 2011
Posts: 9

Rep: Reputation: 0
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?
 
Old 04-22-2011, 05:07 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
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.

#NotIntendedToBeAFactualStatement
Only if it's a Windows VM

Last edited by paulsm4; 04-23-2011 at 02:13 PM.
 
Old 04-22-2011, 05:10 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,001

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
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?

Last edited by jefro; 04-22-2011 at 05:12 PM.
 
Old 04-22-2011, 09:32 PM   #4
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Jefro -

I think the OP was asking if it's possible to take a VM and have it boot itself. "Instead of running as a Virtual Machine".

Homey don't think so
 
Old 04-23-2011, 06:44 AM   #5
blacksiddis
LQ Newbie
 
Registered: Mar 2011
Posts: 9

Original Poster
Rep: Reputation: 0
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.
 
Old 04-23-2011, 04:10 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,001

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
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.
 
Old 04-25-2011, 09:14 PM   #7
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,184

Rep: Reputation: 1765Reputation: 1765Reputation: 1765Reputation: 1765Reputation: 1765Reputation: 1765Reputation: 1765Reputation: 1765Reputation: 1765Reputation: 1765Reputation: 1765
Quote:
Originally Posted by paulsm4 View Post
Jefro -

I think the OP was asking if it's possible to take a VM and have it boot itself. "Instead of running as a Virtual Machine".

Homey don't think so
I do it all the time with Slackware. It can boot as a domU under a NetBSD dom0 or as a bare-metal installation outside Xen.
 
Old 05-03-2011, 01:06 AM   #8
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Slackware can be a VM running under Xen.

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?
 
Old 05-03-2011, 04:31 AM   #9
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,184

Rep: Reputation: 1765Reputation: 1765Reputation: 1765Reputation: 1765Reputation: 1765Reputation: 1765Reputation: 1765Reputation: 1765Reputation: 1765Reputation: 1765Reputation: 1765
Quote:
Originally Posted by paulsm4 View Post
Slackware can be a VM running under Xen.

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.
 
1 members found this post helpful.
Old 05-03-2011, 01:16 PM   #10
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
thanx, gezley !
 
  


Reply

Tags
boot, machine, partition, virtual



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Boot virtual machine without host os karnac01 Linux - Virtualization and Cloud 2 01-23-2011 02:53 PM
RHEL5 Virtual Machine Will Not Go To Boot Prompt? kevmcool Linux - Newbie 1 02-07-2010 07:56 AM
What is a Virtual Machine with boot from usb ?? melmar Linux - Software 2 12-02-2009 02:44 AM
Need to boot kernel in virtual machine viveky Linux - Newbie 2 06-30-2009 04:43 AM
virtualbox's virtual machine start on boot paul_mat Linux - Server 1 03-06-2008 06:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 04:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration