Enable VRDE option for VMs in vbox scripts
VRDE option makes VMs accessible via RDP. Fix vboxmanage to run via execute decorator. Closes-Bug: #1498889 Change-Id: I93560126940457518fc4385c0518ab00d4b3d800
This commit is contained in:
parent
192b30cb61
commit
fdcb374dfb
@ -43,6 +43,11 @@ add_nat_adapter_to_vm $name 3 $vm_master_nat_network
|
||||
# Mount ISO with installer
|
||||
mount_iso_to_vm $name $iso_path
|
||||
|
||||
#add RDP connection
|
||||
if [ ${headless} -eq 1 ]; then
|
||||
enable_vrde $name ${RDPport}
|
||||
fi
|
||||
|
||||
# Start virtual machine with the master node
|
||||
echo
|
||||
start_vm $name
|
||||
|
@ -50,8 +50,14 @@ for idx in $(eval echo {1..$cluster_size}); do
|
||||
add_disk_to_vm $name 2 $vm_slave_third_disk_mb
|
||||
|
||||
#add NIC1 MAC to description
|
||||
mac=$(vboxmanage showvminfo $name |awk -F ': ' '$1~/NIC 1/ {mac=gensub(/^.+ MAC: ([0-9A-F]{12}).+$/,"\\1","g",$0);print mac}')
|
||||
vboxmanage modifyvm $name --description $mac
|
||||
mac=$(execute vboxmanage showvminfo $name |awk -F ': ' '$1~/NIC 1/ {mac=gensub(/^.+ MAC: ([0-9A-F]{12}).+$/,"\\1","g",$0);print mac}')
|
||||
execute vboxmanage modifyvm $name --description $mac
|
||||
|
||||
#add RDP connection
|
||||
if [ ${headless} -eq 1 ]; then
|
||||
enable_vrde $name $((${RDPport} + idx))
|
||||
fi
|
||||
|
||||
enable_network_boot_for_vm $name
|
||||
|
||||
# The delay required for downloading tftp boot image
|
||||
|
@ -181,4 +181,5 @@ vm_slave_third_disk_mb=65535
|
||||
|
||||
# Set to 1 to run VirtualBox in headless mode
|
||||
headless=0
|
||||
RDPport=5000
|
||||
skipfuelmenu="no"
|
||||
|
@ -223,3 +223,12 @@ enable_network_boot_for_vm() {
|
||||
# Set the right boot priority
|
||||
execute VBoxManage modifyvm $name --boot1 net --boot2 disk --boot3 none --boot4 none --nicbootprio1 1
|
||||
}
|
||||
|
||||
enable_vrde(){
|
||||
name=$1
|
||||
port=${2:-$RDPport}
|
||||
|
||||
# Enable VRDE, set port and address
|
||||
execute VBoxManage modifyvm $name --vrde on
|
||||
execute VBoxManage modifyvm $name --vrdeport $port
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user