User Tools

Site Tools


kvm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
kvm [2014/11/24 02:09]
ben
kvm [2014/11/24 02:11] (current)
ben
Line 23: Line 23:
  
 ===== Building a Guest Kernel ===== ===== Building a Guest Kernel =====
-The initrd doesn'​t have a udev implementation,​ so won't create the device nodes for the vda block devices automatically. We have to manually create these, and arrange for them to be available in /dev inside the initrd. ​<tt>/​net/​universe/​mnt/​pool/​kvm/​kernels/​build/​initramfs-overlay</​tt> ​contains a /dev directory, and device nodes copied from an live cd.+The initrd doesn'​t have a udev implementation,​ so won't create the device nodes for the vda block devices automatically. We have to manually create these, and arrange for them to be available in /dev inside the initrd. ​''​/​net/​universe/​mnt/​pool/​kvm/​kernels/​build/​initramfs-overlay'' ​contains a /dev directory, and device nodes copied from an live cd.
  
 The kvm kernel configs also build the virtio device drivers as modules, so these need to be loaded into the initramfs before the main system can boot. Genkernel does not currently include these modules by default, so the default initramfs scripts need to be updated to add support. The kvm kernel configs also build the virtio device drivers as modules, so these need to be loaded into the initramfs before the main system can boot. Genkernel does not currently include these modules by default, so the default initramfs scripts need to be updated to add support.
  
-Edit <tt>module_load</​tt> ​to have the modules included in the initramfs:+Edit ''​module_load'' ​to have the modules included in the initramfs:
 {{File|/​usr/​share/​genkernel/​arch/​x86_64/​module_load|<​code bash> {{File|/​usr/​share/​genkernel/​arch/​x86_64/​module_load|<​code bash>
   - Virtual hardware drivers   - Virtual hardware drivers
Line 33: Line 33:
 </​code>​}} </​code>​}}
  
-Then edit <tt>initrd.default</​tt> ​to recognise the new VIRTIO module group and have the modules modprobe'​d during the <tt>/linuxrc</tt>>+Then edit ''​initrd.default'' ​to recognise the new VIRTIO module group and have the modules modprobe'​d during the ''​/linuxrc''​>
 {{File|/​usr/​share/​genkernel/​default/​initrd.default|<​code bash> {{File|/​usr/​share/​genkernel/​default/​initrd.default|<​code bash>
 HWOPTS='​keymap cache modules pata sata scsi usb firewire waitscan slowusb evms lvm dmraid mdadm fs net virtio'​ HWOPTS='​keymap cache modules pata sata scsi usb firewire waitscan slowusb evms lvm dmraid mdadm fs net virtio'​
Line 64: Line 64:
 </​code>​}} </​code>​}}
  
-This will build a bzip'd tarball of the kernel files, and another package containing all the modules. Extract the kernel files from the archive and put them in the right place. The generated files wont have the correct ​<tt>kernname</​tt> ​either, so fix that at the same time.+This will build a bzip'd tarball of the kernel files, and another package containing all the modules. Extract the kernel files from the archive and put them in the right place. The generated files wont have the correct ​''​kernname'' ​either, so fix that at the same time.
 {{Root|<​code bash> {{Root|<​code bash>
 cd /​net/​universe/​mnt/​pool/​kvm/​kernels/​ cd /​net/​universe/​mnt/​pool/​kvm/​kernels/​
Line 98: Line 98:
 </​code>​}} </​code>​}}
  
-<tt>$ARCH</​tt> ​should be one of <tt>x86_64</​tt> ​or <tt>i686</tt><tt>$RAM</​tt> ​is the amount of memory in MB, and <tt>$DISKSIZE</​tt> ​is the size of the vritual disk drive in GB.+''​$ARCH'' ​should be one of ''​x86_64'' ​or ''​i686''​''​$RAM'' ​is the amount of memory in MB, and ''​$DISKSIZE'' ​is the size of the vritual disk drive in GB.
  
 ===== Creating a new instance of a template ===== ===== Creating a new instance of a template =====
kvm.txt · Last modified: 2014/11/24 02:11 by ben