Deletions are marked like this. | Additions are marked like this. |
Line 31: | Line 31: |
For maximum ease of use, choose Network Install on the first step, and paste in a url from man virt-install. Or just http://ftp.us.debian.org/debian/dists/stable/main/installer-amd64/ |
For maximum ease of use, choose Network Install on the first step, and paste in a url from the --location section of man virt-install. Or just paste in http://ftp.us.debian.org/debian/dists/stable/main/installer-amd64/ |
Line 48: | Line 48: |
# this actually presents a useful error message | |
Line 49: | Line 50: |
# this will error and demand a few additional arguments. # a full invocation might be: |
# so, a full invocation might be: |
Line 55: | Line 55: |
virt-install can use a bunch of different sources for an installation. --location url will do something like a netinst, except what it actually does is walk the distro tree at that URL, download the kernel and initrd and directly run them in the VM. |
To find out what, say, --location does, perform the following operation: 1. open the man page 2. search for it |
Line 61: | Line 59: |
You can instead pass --location dir, --cdrom, --pxe, etc. to use other sources; check the manpage for the full list and other examples of distro URLs. Some useful other arguments: |
Nevertheless, here are some useful arguments: * Installation sources * --location url will figure out what distro tree is at that URL, download the kernel and initrd and directly run them in the VM. Check the man-page for useful URLs to pass it. * --cdrom, --pxe, --import, and others are also available |
Line 67: | Line 67: |
Making a VM
Both of these methods explain how to make a VM using the libvirt tools with a remote connection tunneled over ssh, which can be authenticated any way you please. But you can also just ssh straight to the host and run the tools.
No matter which set of tools you use, you should first make a Netreg entry and make a DNS entry.
kvm02 is the only host in an acceptable state at the moment. So just use that one.
Install the necessary packages to do this remotely!
apt-get install virtinst virt-manager virt-viewer pacman -Ss virt-manager # virt-viewer is in AUR
GUI (virt-manager)
Honestly this is not hard, you can really just follow some random tutorial.
- Start virt-manager.
File->Add Connection, Method: SSH, Username: yourusername, Hostname: kvm02.club.cc.cmu.edu
- Click new VM and follow the prompts. For maximum ease of use, choose Network Install on the first step, and paste in a url from the --location section of man virt-install.
Or just paste in http://ftp.us.debian.org/debian/dists/stable/main/installer-amd64/
Make sure to set the MAC address to the one in NetReg so DHCP does its thing. (This must be done if you're using a network install).
- You're done.
You may want to clubify that machine.
CLI (virsh/virt-install)
# Set LIBVIRT_DEFAULT_URI, like this: export LIBVIRT_DEFAULT_URI=qemu+ssh://$USER@kvm02.club.cc.cmu.edu/system # or add the argument --connect qemu+ssh://$USER@kvm02.club.cc.cmu.edu/system # or just ssh kvm02.club.cc.cmu.edu and do these things # this actually presents a useful error message virt-install # so, a full invocation might be: virt-install --name namium --memory 512 --disk size=10 \ --location http://ftp.us.debian.org/debian/dists/stable/main/installer-amd64/
To find out what, say, --location does, perform the following operation:
- open the man page
- search for it
Nevertheless, here are some useful arguments:
- Installation sources
- --location url will figure out what distro tree is at that URL,
- download the kernel and initrd and directly run them in the VM. Check the man-page for useful URLs to pass it.
- --cdrom, --pxe, --import, and others are also available
- --location url will figure out what distro tree is at that URL,
- Network
- to not be NAT'd, --network bridge=br0,mac=what:you:put:in:net:reg
- Graphics
- to force creation of a graphical display, --graphics vnc or --graphics spice
- to force no creation of graphical display, --graphics none
- if --graphics something isn't present, it'll choose the appropriate one based on whether DISPLAY is set
- Console
- to have a text console available, --extra-args console=ttyS0
- you can attach to the text console with virsh -c url console namium
# FOR THE LAZY: typical cclub invocation virt-install --name $VM_HOSTNAME --memory 512 --disk size=10 \ --network bridge=br0,mac=whatyouputinnetreg \ --extra-args console=ttyS0 \ --location http://ftp.us.debian.org/debian/dists/stable/main/installer-amd64/
OK, you're done! You may want to clubify that machine.
Making a Host
# Install libvirt, which pulls in QEMU/KVM by default apt-get install libvirt-bin virtinst qemu-kvm
Now you can make VMs.
# Configure the networking bridge so we can get non-NAT'd IPs sensible-editor /etc/interfaces/network # Add something like the following (assumes you're using DHCP for the # host rather than static networking) # auto lo br0 # iface lo inet loopback # # iface eth0 inet manual # # iface br0 inet dhcp # bridge_ports eth0 # bridge_stp off
Now you can make VMs that can DHCP to get NetReg'd IPs.
Now you can ssh in, so you can remotely (or over ssh) make VMs.