diff --git a/build.sh b/build.sh index aa1214a..79fff41 100644 --- a/build.sh +++ b/build.sh @@ -72,22 +72,20 @@ if ! $vmsh clearVM $osname; then echo "vm does not exists" fi -if [ ! -e "$osname.qcow2.xz" ]; then - echo "Downloading qcow2 from: $VM_VHD_LINK" - wget -q -O $osname.qcow2.xz "$VM_VHD_LINK" +$vmsh createVM $VM_ISO_LINK $osname $ostype $sshport -fi -if [ ! -e "$osname.qcow2" ]; then - xz -d -T 0 --verbose "$osname.qcow2.xz" -fi +sleep 2 -$vmsh createVMFromVHD $osname $ostype $sshport +$vmsh processOpts $osname "$opts" +while $vmsh isRunning $osname; do + sleep 5 +done $vmsh startVM $osname @@ -100,23 +98,11 @@ sleep 2 waitForText "$VM_LOGIN_TAG" +sleep 2 -sleep 3 - -$vmsh enter $osname -sleep 1 - -$vmsh enter $osname -sleep 1 - -$vmsh enter $osname -sleep 1 - -$vmsh enter $osname -sleep 1 - -inputKeys "string root ; enter ; enter" +inputKeys "string root; enter" +sleep 2 if [ ! -e ~/.ssh/id_rsa ] ; then @@ -135,7 +121,7 @@ echo "" >>enablessh.local echo >>enablessh.local -echo >>enablessh.local +echo "chmod 600 ~/.ssh/authorized_keys">>enablessh.local echo "exit">>enablessh.local echo >>enablessh.local diff --git a/conf/omnios-r151048.conf b/conf/omnios-r151048.conf index ab4e3d3..7c8a634 100644 --- a/conf/omnios-r151048.conf +++ b/conf/omnios-r151048.conf @@ -1,6 +1,6 @@ -VM_VHD_LINK="https://downloads.omnios.org/media/stable/omnios-r151048.cloud.vmdk" +VM_ISO_LINK="https://downloads.omnios.org/media/stable/omnios-r151048.iso" VM_OS_NAME="omnios" VM_OS_TYPE="omnios" VM_SSH_PORT=2222