Gentoo Archives: gentoo-user

From: Kai Krakow <hurikhan77@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Running Gentoo in VirtualBox
Date: Mon, 01 Jan 2018 12:44:30
Message-Id: n1nphe-a7q.ln1@hurikhan77.spdns.de
In Reply to: [gentoo-user] Running Gentoo in VirtualBox by thelma@sys-concept.com
Am Sun, 31 Dec 2017 12:40:43 -0700 schrieb thelma:

> I'm using Gentoo as a server (so it runs 24/7) Apache, Asterisk, Hylafax > etc. > > What are my chances to run Gentoo as a VirtualBox? > > Installing Gentoo takes me 2-3 days (basic setup min., I don't do it > every month so I have to go through Gentoo handbook); to configure it > the way I want it takes another week or two.
I recommend having a template Gentoo system with the basic setup and basic world set you need. Keep that updates once in a while. If you need to deploy a new system, simply clone from this. I'm doing something similar with our servers: Upon deploying a new server, I just clone a most similar one, excluding the data partitions. Then I cleanup world, make.conf, passwd/groups, reset the machine uid in /etc, adjust IP configuration, and run "emerge -- depclean" followed by a world upgrade. This can be made easier if you're planning your mount volumes correctly, that is having mysql, home, hylafax whatever on separate partitions. It allows you to run rsync without crossing mount borders. This works for me since 10+ years of running Gentoo based servers now.
> So I was thinking, if I run Windows 10 and configure Gentoo as a > virtual box it might be easier to transfer it from one system to > another, in case there is a HD failure (like it just happened to me > yesterday). > > Any input will be appreciated.
I usually virtualize systems by first preparing the kernel to have support for VirtualBox or VMware, then installing the proper tools. After this, prepare the VM and empty disk images, boot sysrescuecd in it (which is actually Gentoo based), format and mount your empty disk images in it (within the final structure, so you pre-create mount points), then use rsync over SSH (as root) to transfer all files. You can do that while the source system is still online. Keep in mind not to rsync special directories like /sys or /proc from the source. Create empty mount points instead. Then try to boot the system offline (do not yet connect it to virtual networking), see if it boots. If not, try to fix it and record the steps. You can also chroot into the cloned system from sysrescuecd. Now it's time for resync. Stop services on the source system so it quasi- offline, just keep sshd running. Now, rsync again. It will now copy the differences in just a few seconds to minutes. Maybe reapply the previously recorded fixing steps, then boot the cloned system and shut the other system down. If source and destination is the same hardware, you may want to use an external drive as intermediate rsync storage. But then you have an offline system you cannot boot in case of failure. It's a bit harder then if you do it the first time. But it also works great if you are familiar with the process.
> I know I might have problem with Serial port and receiving faxes via > HylaFax as they are time sensitive.
Serial port usually does work in pass-through mode, I've done exactly that previously with hylafax. -- Regards, Kai Replies to list-only preferred.