=== modified file 'templates/libvirt.tmpl'
--- templates/libvirt.tmpl 2008-05-17 14:58:21 +0000
+++ templates/libvirt.tmpl 2008-08-11 21:27:56 +0000
@@ -15,9 +15,9 @@
destroy
/usr/bin/%VM%
-
+
-
+
=== modified file 'templates/vmware.tmpl'
--- templates/vmware.tmpl 2008-03-14 17:15:36 +0000
+++ templates/vmware.tmpl 2008-08-11 23:31:29 +0000
@@ -5,7 +5,8 @@
memsize = "%MEM%"
Ethernet0.virtualDev = "vlance"
Ethernet0.present = "TRUE"
-Ethernet0.connectionType = "bridged"
+Ethernet0.connectionType = "custom"
+Ethernet0.vnet = "%NETNAME%"
displayName = "%HOSTNAME% %ARCH%"
guestOS = "%guestos%"
priority.grabbed = "normal"
=== modified file 'ubuntu-vm-builder'
--- ubuntu-vm-builder 2008-06-19 15:13:06 +0000
+++ ubuntu-vm-builder 2008-08-11 22:01:53 +0000
@@ -88,6 +88,7 @@
[--bcast value]
[--gw address]
[--dns address] ]
+ [--bridge bridgeinterface ]
vm Generate image for the specified virtualisation software.
Valid choices are: vmw6 vmserver vbox qemu kvm
@@ -174,6 +175,7 @@
--firstlogin PATH Specify a script that will be copied into the guest and
will be executed the first time the user logs in. This
script can be interactive.
+--bridge BRIDGE Specify an bridge interface that the guest will be bridge to.
--ip ADDRESS Ip address in dotted form
(defaults to dhcp if not specified)
@@ -243,7 +245,7 @@
. /usr/share/ubuntu-vm-builder/config-handler
set +e; trap "usage;exit 1" ERR
-TEMP=`getopt -o a:d:ohs:t:vc: --long addpkg:,arch:,dest:,overwrite,domain:,help,hostname:,mem:,mirror:,security-mirror:,iso:,removepkg:,suite:,tmp:,tmpfs:,vm:,user:,name:,pass:,part:,rootsize:,swapsize:,optsize:,raw:,ip:,mask:,net:,bcast:,gw:,dns:,kernel-flavour:,components:,ssh-key:,ssh-user-key:,no-opt,exec:,firstboot:,firstlogin:,verbose,in-place,$vm_getopt_args -- "$@"`
+TEMP=`getopt -o a:d:ohs:t:vc: --long addpkg:,arch:,dest:,overwrite,domain:,help,hostname:,mem:,mirror:,security-mirror:,iso:,removepkg:,suite:,tmp:,tmpfs:,vm:,user:,name:,pass:,part:,rootsize:,swapsize:,optsize:,raw:,ip:,mask:,net:,bcast:,gw:,dns:,bridge:,kernel-flavour:,components:,ssh-key:,ssh-user-key:,no-opt,exec:,firstboot:,firstlogin:,verbose,in-place,$vm_getopt_args -- "$@"`
trap - ERR; set -e
eval set -- "$TEMP"
@@ -399,6 +401,11 @@
--dns)
DNS=$2
shift 2
+ ;;
+ --bridge)
+ NETTYPE=bridge
+ NETNAME=$2
+ shift 2
;;
--no-opt)
echo "Ignored obsolete --no-opt option"
=== modified file 'vms/qemu-common'
--- vms/qemu-common 2008-05-26 20:08:56 +0000
+++ vms/qemu-common 2008-08-11 23:22:38 +0000
@@ -88,6 +88,8 @@
-e "s/%LIBVIRTNAME%/${LIBVIRTNAME}/g" \
-e "s/%MEM%/$(( $MEM * 1024 ))/g" \
-e "s/%MAC%/${MAC}/g" | \
+ awk -vnettype="$NETTYPE" '{ if (nettype) gsub(/%NETTYPE%/, nettype) ; else gsub(/%NETTYPE%/, "network") ; print }' | \
+ awk -vnetname="$NETNAME" '{ if (netname) gsub(/%NETNAME%/, netname) ; else gsub(/%NETNAME%/, "default") ; print }' | \
awk -vrep="$devices" '/%loop%/{print rep}
/%loop/,/%\/loop%/{next}
1'> ${LIBVIRTXML}
=== modified file 'vms/vmware-common'
--- vms/vmware-common 2008-05-24 22:42:51 +0000
+++ vms/vmware-common 2008-08-11 23:33:24 +0000
@@ -47,7 +47,8 @@
-e "s/%HOSTNAME%/${VMHOSTNAME}/g" \
-e "s/%MEM%/${MEM}/g" \
-e "s/%ARCH%/${ARCH}/g" \
- -e "s/%guestos%/${guestos}/g" \
+ -e "s/%guestos%/${guestos}/g" | \
+ awk -vnetname="$NETNAME" '{ if (netname) gsub(/%NETNAME%/, netname) ; else gsub(/%NETNAME%/, "/dev/vmnet0") ; print }' \
> $VMHOSTNAME.vmx
chmod +x $VMHOSTNAME.vmx