LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Virtualbox VM to Physical hardware? (https://www.linuxquestions.org/questions/linux-newbie-8/virtualbox-vm-to-physical-hardware-4175411466/)

secondhandman 06-14-2012 12:08 PM

Virtualbox VM to Physical hardware?
 
Their must be a simple way to use a VM of Ubuntu 11.04 with LAMP, etc. and copying it to a physical machine for use in production?

I've tried a few things with no luck. Very new to this!

Kustom42 06-14-2012 12:13 PM

You would have to build out your new server and rsync your data across... no other easy solution unless you setup a config app like puppet to push your content/configs out to new servers.

secondhandman 06-14-2012 12:41 PM

I've backed up root using tar, I wonder if I could use a live cd, install to the physical computer from the cd and copy over my backup.tar file.

I also have a backup using deja dup.

There must be a simple way!

TobiSGD 06-14-2012 12:56 PM

The simplest way I could think of would be Clonezilla. Your can also use a LiveCD to just rsync the files to the physical machine (absolutely no need to install first), then install a bootloader. Won't get much simpler.

Kustom42 06-14-2012 03:05 PM

You cant really use clonezilla or another disk to disk copy sort of method due to the hardware differences. You will need to do a clean OS install then copy over your content. I refresh servers to new hardware on a daily basis and yes I wish it were easier but thats the way it is.

jefro 06-14-2012 03:21 PM

I disagree that you can't move it via clonezilla. Generally can work.

I also agree that the old standard of clean install used to be true. Today a modern linux doesn't care what hardware it is on.

You are correct in that a clean install would be or tends to be best.

You can use a V2P app.
You can use dd or tar or other clone copy tool.

You can use G4U if you want.

The basic issue here is that a virtual machine is to be considered a real computer. Any task that can move a real computer can usually move this issue.

I have even used dd over ftp and dd over netcat to clone.

You need to watch out for how some computers boot. Some systems may say disk by id or disk by name in grub or use different geometry or names to boot so you'd have to fix it.


I am not sure I'd go from a VM to a real system. Seems backwards.

TobiSGD 06-14-2012 04:20 PM

Quote:

Originally Posted by Kustom42 (Post 4703399)
You cant really use clonezilla or another disk to disk copy sort of method due to the hardware differences. You will need to do a clean OS install then copy over your content. I refresh servers to new hardware on a daily basis and yes I wish it were easier but thats the way it is.

I had no problems to clone the OS from my laptop (AMD CPU+Chipset+Graphics) to my netbook (Intel CPU+Chipset+Graphics), except that I forgot to install the X.Org driver for the Intel graphics. No other problems. As long as you don't have proprietary drivers installed there should be no problem. The kernel looks anyways everytime at boot which hardware is present at boot. I had such incompatibility issues with Windows XP and older, but since Vista they are rare even on Windows.

secondhandman 06-14-2012 09:17 PM

Is there a way to use the back up I have using Deja Dup? I have a fresh install of Ubuntu 11.04 (physical) and I believe it's using the same version of gnome as the VM it came from.. I have the root of the VM backed up and copied to the Documents of my home folder on the physical machine. I know I can simply write over the entire root drive!

I can use dd to write the image of the VMs root to a flash drive? and how would I go about using the image with the physical machine?

I'm looking into all your suggestions!! I've tried Clonezilla, but find it tough to use. I'll look into it again!!

Thanks for the reply's!

AwesomeMachine 06-14-2012 09:21 PM

You can't use a VM on bare metal. I've tried! There may be some way, but it isn't going to be fun.

jefro 06-15-2012 03:25 PM

We are talking dd here or other ways to copy a hard drives content aren't we?

If you have a dd image of either a real hard drive or a virtual hard drive then the two are for this question the same. You can treat them as equal. IF something and OF it is the way it works. Bit by bit the data is moved.


Clonezilla saves some drive specific data. If we know about the failure then we might be able to fix it.

The now presented issue of the USB raises other issues.

The problems of moving an install may be simple to fix if you have ways to diag the failures. If you want you can do a test install from your dd image to the real machine. At this point, don't consider any sort of install OS and then try to add in data on top. You are simply trying a complete wipe of the storage media.

secondhandman 06-15-2012 05:12 PM

This is what I have worked out so far:

What has been installed on the VM can be found by running the following command at the terminal:
dpkg --get-selections > installed-software

and to restore on the physical machine I transferred the installed-software file to a usb and ran the following (this will download and install items listed in installed-software):
dpkg --set-selections < installed-software && dselect

From there I used Deja Dup to restore any files that held configurations and was careful to not overwrite anything that might break the system. I had to redo permissions to get somethings working. I'm guessing that's because I backed up as a user, not root..

Thanks for the help. I'm still looking into your suggestions!!

secondhandman 06-15-2012 05:15 PM

Can I now just back up the whole system by making a bootable image?

jefro 06-15-2012 07:41 PM

If you now have a good working physical machine then you could make some image. Not worth the trouble to make it bootable unless you mean you are trying to get an external usb hard drive working.

From what you did, I feel that it may have worked. More that one way to do stuff. Use what you know is best.


All times are GMT -5. The time now is 12:05 PM.