djwong: (Default)
Bogus J. Simpson ([personal profile] djwong) wrote2012-10-15 11:49 am

How to Set Up kvm MTR

You are going to create a chroot on a VM host, then set up a PXE environment to net-boot the system. Let %CHROOT% be the chroot location on the host; %VM_NET_IP% be the IP address of the local VM network; %VM_NET_CIDR% be the CIDR of the local VM network; and %VM_NET_BRIDGE% be the name of the bridge that ties together the local VM network.

1. Use debootstrap to set up a chroot at %CHROOT%.
2. Add full set of Ubuntu repos to %CHROOT%.
3. Use djwong repo install.sh to install djwong package sources.
4. chroot %CHROOT% su - root
5. apt-get install djwong-mtr djwong-kernel-support
6. Install some sort of kernel.
7. Jump out to host.
8. virsh net-destroy default
9. virsh net-edit default
10. Add "<tftp root="%CHROOT%/boot/" />" as a child of the <ip> element.
11. Add "<bootp file="pxelinux.0" />" as a child of the <dhcp> element.
12. virsh net-start default
13. apt-get install nfs-kernel-server
14. Add "%CHROOT%/ %VM_NET_CIDR%(ro,sync,no_root_squash,no_subtree_check)" to /etc/exports. Do not be tempted to add "-H %VM_NET_IP%" to /etc/default/nfs-kernel-server; this will result in NFS3 being disabled due to braindead nfs init script!
15. /etc/init.d/nfs-kernel-server restart
16. ufw enable
17. ufw allow ssh
18. ufw allow cups
19. ufw allow in on %VM_NET_BRIDGE%
20. Create a VM with e1000 (not virtio-net) NIC, set to boot PXE.
21. Start VM.

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting