[OpenIndiana-discuss] An installation report and a few questions from a Solaris neophyte.

Till Wegmüller toasterson at gmail.com
Tue May 8 10:06:17 UTC 2018


Hi Lazarus

On 08.05.2018 11:36, Michal Nowak wrote:

> 
> Perhaps KVMadm from SFE repo is what you are looking for:
> 
> http://sfe.opencsw.org/quickrepolinks
> http://sfe.opencsw.org/localhostoih/en/search.shtml?token=kvmadm&action=Search
> 
> https://github.com/hadfl/KVMadm/blob/master/README.md
> 

A Simple Shell script is usually enough to run kvm I use the following.

'''ksh
#!/usr/bin/ksh

# configuration
VNIC=vnic4
# Sample zvol path.
HDD=/dev/zvol/rdsk/rpool1/kvm/jenkins-alpine/disk0
CD=/root/alpine-virt-3.7.0-x86_64.iso
VNC=0
# Memory for the KVM instance, in Mebibytes (2^20 bytes).
MEM=2048
# Virtual CPUs for the instance
CPUS=2

mac=`dladm show-vnic -po macaddress $VNIC`

/usr/bin/amd64/qemu-system-x86_64 \
    -name "$(basename $CD)" \
    -boot cd \
    -enable-kvm \
    -nodefaults \
    -vnc :$VNC \
    -monitor telnet:localhost:7000,server,nowait,nodelay \
    -smp $CPUS \
    -m $MEM \
    -no-hpet \
    -localtime \
    -drive file=$HDD,if=virtio,index=0 \
    -drive file=$CD,media=cdrom,if=ide,index=2  \
    -net nic,vlan=0,name=net0,model=e1000,macaddr=$mac \
    -net vnic,vlan=0,name=net0,ifname=$VNIC,macaddr=$mac \
    -vga std \
    -daemonize

if [ $? -gt 0 ]; then
    echo "Failed to start VM"
fi
'''

I place this under the zfs dataset of the vm (rpool1/kvm/jenkins-alpine
in this case) as init.sh make it executable and just connect via ssh and
run the vm.

That gives you a telnet port on localhost:7000 to look into the vm
console if you want to to anything there. and a VNC on :0 on the host.

This is easiest to put into a zone as the zone will only need the
priviledges and the it's good to go. Which is best to do homework first
before using something more automagic like kvmadm.

Hope this helps
Greetings
Till



More information about the openindiana-discuss mailing list