Tomas Mozes <tomas.mo...@shmu.sk> writes: > On 2014-12-04 11:08, lee wrote: >> Tomas Mozes <tomas.mo...@shmu.sk> writes: >> >>> On 2014-12-04 02:14, lee wrote: >>>> Hi, >>>> >>>> I'd like to give Gentoo a try and want to install it in a xen VM. >>>> The >>>> server is otherwise running Debian. What would be the best way to do >>>> this? >>> >>> Either you can run a virtual machine using paravirtualization (PV) or >>> full virtualization (HVM). >>> >>> If you want to use PV, then you create a partition for Gentoo, chroot, >>> unpack stage3 and prepare your system for booting (follow the >>> handbook). Then you create a configuration for your xen domU (Gentoo), >>> provide a kernel and start it. You don't need the install-cd in this >>> situation, nor any bootloader. >> >> That's like what I thought I should do :) >> >> I'd like to use PV as it has some advantages. How do I provide a >> kernel? Is it contained in the stage3 archive? >> >> And no bootloader? How do I make the VM bootable then? >> >> All the guests are PV and use something called phygrub of which I don't >> know where it comes from. >> >> This installation process with xen is some sort of mystery to me. With >> Debian, I used a somehow specially prepared kernel which booted the >> Debian installer. From there, the installation was the same as >> installing on bare metal. > > The kernel is not in stage3, you have to compile it yourself (or > download from somewhere). When you have the kernel image binary, the > xen configuration for the host can be simple as:
Compile it with what? Are the sources in stage3, or downloaded so that I can compile a suitable Gentoo kernel within the chroot? > name = "gentoobox" > kernel = "/xen/_kernel/kernel-3.14.23-gentoo-xen" > extra = "root=/dev/xvda1 net.ifnames=0" > memory = 2500 > vcpus = 4 > vif = [ '' ] > disk = [ '/dev/vg_data/gentoo-t1_root,raw,xvda1,rw' ] 'raw'? I'll have to look up what that does. > You can read about PV: > http://wiki.xenproject.org/wiki/Paravirtualization_%28PV%29 > >> >>> If you prefer HVM, then you create a partition and use the install-cd >>> to boot. After your install cd boots up, you partition your disk >>> provided by xen dom0 (Debian), chroot, unpack stage3 and install the >>> system along with the kernel and a bootloader. You can boot your >>> Gentoo with pvgrub that will handle the booting to grub and it will >>> load the kernel. This way, the Gentoo machine is like a black box for >>> your Debian. >>> >>> I would recommend starting with HVM. >> >> Hm, I haven't used HVM yet. Can I change over to PV after the >> installation is done? What's the advantage of starting with HVM? >> >> The "disk" is an LVM volume and won't be partitioned. I've found it >> more reasonable to use a separate LVM volume for swap. >> >> I never installed Gentoo. I could start with my desktop since I >> want to >> replace Fedora anyway. That's a bit troublesome because I either have >> to plug in some disks for it which I'd need to buy first (I might get >> two small SSDs), or I'd have to repartition the existing ones. >> >> Hmmm. I think I'll try a VM with PV first. If that doesn't work, no >> harm is done and I can still ask when I'm stuck. >> >> >> Oh I almost forgot: Does the VM need internet access during the >> installation? The network setup is awfully complicated in this case. > > Well, you can copy the files to another place, but I have never done > this transformation. HVM is like a black box, you start like booting a > normal machine. For production, I always use PV, but for starters, HVM > is also fine. So you cannot easily change from HVM to PV? > Yes, you will need internet access because we compile everything as it > goes, so you need to download the source files. Or, maybe you can > download a livedvd, but I've never tried that. > > Why is the networking complicated? Do you use bridging? Yes --- and it was terrible to begin with and still is very complicated. One of the VMs has a network card passed through to do pppoe for the internet connection, and it also does routing and firewalling. The Gentoo VM is supposed to have another network card passed through because I want a separate network for miscellaneous devices like IP phones and printers. Asterisk is going to run on the Gentoo VM. Besides devices, there's the usual net, dmz and loc zones. To top it off, sooner or later I want to pass another network card to the firewall/router because I have an internet connection which is currently not in use and should be employed as an automatic fallback. -- Again we must be afraid of speaking of daemons for fear that daemons might swallow us. Finally, this fear has become reasonable.