$ kvm-ok
INFO: Your CPU supports KVM extensions
INFO: /dev/kvm exists
KVM acceleration can be used
$ uname -a
Linux pdp11 2.6.32-24-serer #43-Ubuntu SMP Thu Sep 16 16:05:42 UTC 2010 x86_64 GNU/Linux
$ virt-install -n creat -r 500 \
-f creat.img -s 10 \
-c /opt/ubuntu-10.04.1-server-amd64.iso --accelerate \
--connect=qemu:///system --vnc --noautoconsole -v
$ cat /usr/local/bin/v
set -x
exec virsh --connect qemu:///system "$@"
root@pdp11:~/creat-vm# lvcreate -n lv-creat-2 --size=31G pdp11
Logical volume "lv-creat-2" created
$ dd bs=64k if=creat.img of=/dev/pdp11/lv-creat-2
# v list --all
++ exec virsh --connect qemu:///system list --all
Id Name State
----------------------------------
- creat shut off
- ubuntu shut off
# virt-viewer creat
======================================
Static IPs: 173.8.190.56 173.8.190.57 173.8.190.58 173.8.190.59
Gateway: 173.8.190.62
Netmask: 255.255.255.240
Comcast DNS: 68.87.76.178 (primary) 66.240.48.9 (secondary)
lvcreate --size 80G --name eniac_all_m vg01010m
mount /dev/vg01010m/eniac_all_m /m/eniac_all_m
root@pdp11:/m/eniac_all_m# lvextend -L +30G /dev/vg01010m/eniac_all_m /dev/sdb4
Extending logical volume eniac_all_m to 110.00 GiB
Logical volume eniac_all_m successfully resized
ssh -vAX -L5900:127.0.0.1:5900 -L5901:127.0.0.1:5901 root@pdp11.yak.net
Allow private 192.168.122.9 (a Kvm Guest in Virtual Network configuration ) to be available to the world as 173.8.190.58 (a public IP we have). It will not be visible to the Kvm Host at that address; instead the Kvm Host sees itself there.
ifconfig eth0:1 netmask 255.255.255.255 173.8.190.58
: iptables -F -v -t nat ## Dont do this -- guests can access outer internet (for dns, updates).
iptables -t nat -I PREROUTING -i eth0 -d 173.8.190.58 -j DNAT --to-destination 192.168.122.9
iptables -t nat -I POSTROUTING -o eth0 -s 192.168.122.9 -j SNAT --to-source 173.8.190.58
iptables -I FORWARD -i eth0 -d 192.168.122.9 -j ACCEPT
iptables -I FORWARD -o eth0 -s 173.8.190.58 -j ACCEPT
root@pdp11:~# cat /etc/libvirt/qemu/networks/default.xml
<network>
<name>default</name>
<bridge name="virbr%d" />
<forward/>
<ip address="192.168.122.1" netmask="255.255.255.0">
<dhcp>
<range start="192.168.122.200" end="192.168.122.254" />
</dhcp>
</ip>
</network>
virt-install -n nepal -r 500 \
-f /dev/vg01010m/nepal_lv \
-c /opt/ubuntu-10.04.1-server-amd64.iso \
--accelerate --connect=qemu:///system --vnc --noautoconsole -v \
##
On a new box:
http://www.debian-administration.org/users/endecotp/weblog/2
Posted by daemon (155.232.xx.xx) on Wed 11 Jul 2007 at 22:32
I'll try and get in here before anyone else does:
Use iproute.
For this kind of job, using iproute really is much easier, so instead of:
ifconfig eth0:0 netmask 255.255.255.224 x.y.z.2
you would use:
ip addr add x.y.z.2/27 dev eth0
which you can also stick in your /etc/network/interfaces with a post-up command...
cmp(Ubuntu,RedHat) update-rc.d - install and remove System-V style init script links