1 |
On 2014-12-04 11:08, lee wrote: |
2 |
> Tomas Mozes <tomas.mozes@××××.sk> writes: |
3 |
> |
4 |
>> On 2014-12-04 02:14, lee wrote: |
5 |
>>> Hi, |
6 |
>>> |
7 |
>>> I'd like to give Gentoo a try and want to install it in a xen VM. |
8 |
>>> The |
9 |
>>> server is otherwise running Debian. What would be the best way to do |
10 |
>>> this? |
11 |
>> |
12 |
>> Either you can run a virtual machine using paravirtualization (PV) or |
13 |
>> full virtualization (HVM). |
14 |
>> |
15 |
>> If you want to use PV, then you create a partition for Gentoo, chroot, |
16 |
>> unpack stage3 and prepare your system for booting (follow the |
17 |
>> handbook). Then you create a configuration for your xen domU (Gentoo), |
18 |
>> provide a kernel and start it. You don't need the install-cd in this |
19 |
>> situation, nor any bootloader. |
20 |
> |
21 |
> That's like what I thought I should do :) |
22 |
> |
23 |
> I'd like to use PV as it has some advantages. How do I provide a |
24 |
> kernel? Is it contained in the stage3 archive? |
25 |
> |
26 |
> And no bootloader? How do I make the VM bootable then? |
27 |
> |
28 |
> All the guests are PV and use something called phygrub of which I don't |
29 |
> know where it comes from. |
30 |
> |
31 |
> This installation process with xen is some sort of mystery to me. With |
32 |
> Debian, I used a somehow specially prepared kernel which booted the |
33 |
> Debian installer. From there, the installation was the same as |
34 |
> installing on bare metal. |
35 |
|
36 |
The kernel is not in stage3, you have to compile it yourself (or |
37 |
download from somewhere). When you have the kernel image binary, the xen |
38 |
configuration for the host can be simple as: |
39 |
name = "gentoobox" |
40 |
kernel = "/xen/_kernel/kernel-3.14.23-gentoo-xen" |
41 |
extra = "root=/dev/xvda1 net.ifnames=0" |
42 |
memory = 2500 |
43 |
vcpus = 4 |
44 |
vif = [ '' ] |
45 |
disk = [ '/dev/vg_data/gentoo-t1_root,raw,xvda1,rw' ] |
46 |
|
47 |
You can read about PV: |
48 |
http://wiki.xenproject.org/wiki/Paravirtualization_%28PV%29 |
49 |
|
50 |
> |
51 |
>> If you prefer HVM, then you create a partition and use the install-cd |
52 |
>> to boot. After your install cd boots up, you partition your disk |
53 |
>> provided by xen dom0 (Debian), chroot, unpack stage3 and install the |
54 |
>> system along with the kernel and a bootloader. You can boot your |
55 |
>> Gentoo with pvgrub that will handle the booting to grub and it will |
56 |
>> load the kernel. This way, the Gentoo machine is like a black box for |
57 |
>> your Debian. |
58 |
>> |
59 |
>> I would recommend starting with HVM. |
60 |
> |
61 |
> Hm, I haven't used HVM yet. Can I change over to PV after the |
62 |
> installation is done? What's the advantage of starting with HVM? |
63 |
> |
64 |
> The "disk" is an LVM volume and won't be partitioned. I've found it |
65 |
> more reasonable to use a separate LVM volume for swap. |
66 |
> |
67 |
> I never installed Gentoo. I could start with my desktop since I want |
68 |
> to |
69 |
> replace Fedora anyway. That's a bit troublesome because I either have |
70 |
> to plug in some disks for it which I'd need to buy first (I might get |
71 |
> two small SSDs), or I'd have to repartition the existing ones. |
72 |
> |
73 |
> Hmmm. I think I'll try a VM with PV first. If that doesn't work, no |
74 |
> harm is done and I can still ask when I'm stuck. |
75 |
> |
76 |
> |
77 |
> Oh I almost forgot: Does the VM need internet access during the |
78 |
> installation? The network setup is awfully complicated in this case. |
79 |
|
80 |
Well, you can copy the files to another place, but I have never done |
81 |
this transformation. HVM is like a black box, you start like booting a |
82 |
normal machine. For production, I always use PV, but for starters, HVM |
83 |
is also fine. |
84 |
|
85 |
Yes, you will need internet access because we compile everything as it |
86 |
goes, so you need to download the source files. Or, maybe you can |
87 |
download a livedvd, but I've never tried that. |
88 |
|
89 |
Why is the networking complicated? Do you use bridging? |