YaK:: Ubuntu Lucid KVM Notes [Changes]   [Calendar]   [Search]   [Index]   [PhotoTags]   

Ubuntu Lucid KVM Notes

$ 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

Creating a VM named "creat"

$ 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

Shortcut to virsh. "v help"

$ cat /usr/local/bin/v
set -x
exec virsh --connect  qemu:///system "$@"

lvcreate lv-creat-2

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:



Comcast DNS: (primary) (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: -L5901: root@pdp11.yak.net

Poor Man's Bridge, using DNAT & SNAT.

Allow private (a Kvm Guest in Virtual Network configuration ) to be available to the world as (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

: iptables -F -v -t nat ## Dont do this -- guests can access outer internet (for dns, updates).
iptables  -t nat -I PREROUTING  -i eth0 -d  -j DNAT --to-destination
iptables  -t nat -I POSTROUTING -o eth0 -s -j SNAT --to-source

iptables         -I FORWARD  -i eth0 -d -j ACCEPT
iptables         -I FORWARD  -o eth0 -s  -j ACCEPT

Limit DHCP space to the 200's.

root@pdp11:~# cat /etc/libvirt/qemu/networks/default.xml
  <bridge name="virbr%d" />
  <ip address="" netmask="">
      <range start="" end="" />


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:


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 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

VPN for Android Phone

  • http://rootmanager.com/ubuntu-ipsec-l2tp-windows-domain-auth/setting-up-openswan-xl2tpd-with-native-windows-clients.html

  • http://www.jacco2.dds.nl/networking/freeswan-l2tp.html

  • http://www.linuxquestions.org/questions/linux-networking-3/ipsec-l2tp-vpn-server-on-ubuntu-for-iphone-718264/
  • (unless otherwise marked) Copyright 2002-2014 YakPeople. All rights reserved.
    (last modified 2011-01-05)       [Login]
    (No back references.)