[OmniOS-discuss] kvm vnic dhcp disabled, how to enable?

Geoff Nordli geoffn at gnaa.net
Sat Sep 14 05:55:20 UTC 2013


Figured it out, I had a tab on the -net vnic line, which is didn't like.

-net vnic,vlan=0,name=net0,ifname=$VNIC,macaddr=$mac, \
         ip=$IP,netmask=$NETMASK,gateway_ip=$GATEWAY_IP, \
         dns_ip1=$DNS_IP1,hostname=$HOSTNAME,lease_time=$LEASE \

removing the extra spaces fixed the problem and enabled the dhcp.

On 13-09-13 09:19 PM, Geoff Nordli wrote:
> When I try using the built-in dhcp server for KVM it says it is 
> disabled.  How do I enable it?
>
> I pulled the settings from:
>
> https://github.com/joyent/illumos-kvm-cmd/blob/master/README.md
>
> this is the error message:
> qemu-system-x86_64: -net 
> vnic,vlan=0,name=net0,ifname=ubuntu1204,macaddr=2:8:20:de:a6:b9,: vnic 
> dhcp disabled
>
> I am using this script:
>
> VNIC=ubuntu1204
> HDD=/dev/zvol/rdsk/tank/kvm_ubuntu1204
> CD=/tank/dvd/ubuntu-12.04.3-server-amd64.iso
> VNC=1
> MEM=2048
> HOSTNAME=test1
> IP=10.10.64.200
> NETMASK=255.255.0.0
> GATEWAY_IP=10.10.64.2
> DNS_IP1=192.168.2.1
> LEASE=7200
>
> mac=`dladm show-vnic -po macaddress $VNIC`
>
> /usr/bin/qemu-system-x86_64 \
> -name "$(basename $CD)" \
> -boot cd \
> -enable-kvm \
> -vnc 0.0.0.0:$VNC \
> -smp 2 \
> -m $MEM \
> -no-hpet \
> -localtime \
> -drive file=$HDD,if=ide,index=0 \
> -drive media=cdrom,if=ide,index=2  \
> -net nic,vlan=0,name=net0,model=virtio,macaddr=$mac \
> -net vnic,vlan=0,name=net0,ifname=$VNIC,macaddr=$mac, \
>         ip=$IP,netmask=$NETMASK,gateway_ip=$GATEWAY_IP, \
>         dns_ip1=$DNS_IP1,hostname=$HOSTNAME,lease_time=$LEASE \
> -vga std \
> -daemonize
>
> if [ $? -gt 0 ]; then
>     echo "Failed to start VM"
> fi
>
> port=`expr 5900 + $VNC`
> public_nic=$(dladm show-vnic|grep vnic1|awk '{print $2}')
> public_ip=$(ifconfig $public_nic|grep inet|awk '{print $2}')
>
> echo "Started VM:"
> echo "Public: ${public_ip}:${port}"
>
> thanks,
>
> Geoff
>
>



More information about the OmniOS-discuss mailing list