Windows 10 Guest - Immutable Disk - Guest Tools Failing

Discussions about using Windows guests in VirtualBox.
Post Reply
Avarian
Posts: 2
Joined: 5. Feb 2018, 21:15

Windows 10 Guest - Immutable Disk - Guest Tools Failing

Post by Avarian »

Hi,

I am encountering a strange issue with Windows as a guest on an immutable disk. The VM is dynamically created through a shell script and the immutable disk is added to the VM. Once execution of the VM is stopped the whole thing is destroyed. This has worked perfectly for a number of months; however, we have noticed an issue that has occurred with every Windows VM. After about 5 months of operation, regardless of host OS but in this case the host is CentOS, certain things in the VM stop working (mainly the guest addons). If we reboot the VM then they work fine, but on initial boot they no longer seem to function. I have noticed that issue appears to be clock related, is anyone aware of a certificate or something that may be going stale? If I set the vdi to read/write, load the VM everything is right as rain. I can then set it back to immutable and things seem to work correctly. This isn't really a good option as we are talking about a 160ish machine lab setup using the VM (each machine has a copy) so updating them could be an issue.

Thanks.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Windows 10 Guest - Immutable Disk - Guest Tools Failing

Post by socratis »

Script please? I'll need to replicate what you're trying, no?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Avarian
Posts: 2
Joined: 5. Feb 2018, 21:15

Re: Windows 10 Guest - Immutable Disk - Guest Tools Failing

Post by Avarian »

The script is pretty much linked to our environment, but for reference here it is:

fcs-win10-ads-vm:

Code: Select all

#!/bin/sh

/opt/fcs/bin/fcs-launch-vm --vmname fcs-win10-ads \
                           --natnetname android-nat-net \
                           --natnetip 10.0.2.0/24 \
                            $@
fcs-launch-vm:

Code: Select all

#!/bin/sh

#
# Import common functions and variables
#
. /opt/fcs/bin/fcs-vm-script-functions

# Defaults (more after VMName is determined below)
FULLSCREEN=""
READWRITE=""
XSESSION=""
# Logging is disabled for Xsession since it is logged already
LOG="true"
# Delete VM after use (on applies when drive is immutable/disabled with --readwrite)
DELETE="--delete"
RAM=
CPUS=

# Process command line arguments
while [[ $# -ge 1 ]]
do
  arg="$1"

  case $arg in
      -vm|--vmname)
      VMNAME="$2"
      shift
      ;;
      -nnn|--natnetname)
      NATNETNAME="$2"
      shift
      ;;
      -nnip|--natnetip)
      NATNETIP="$2"
      shift
      ;;
      -f|--fs|-fs|--fullscreen)
      FULLSCREEN=--fullscreen
      ;;
      -rw|--rw|--read-write)
      READWRITE=true
      ;;
      -x|-xs|--xs|--xsession)
      XSESSION=true
      FULLSCREEN=--fullscreen
      ;;
      *)
      printusage
      exit
      ;;
  esac
  shift # past argument or value
done

if [ "$VMNAME" == "" ]
then
  echo "No VM Name Given"
  echo "use --vmname <VMName>"
  exit 1
fi

# Set DIRs/IMG based upon VMName
VMDIR=/opt/fcs/vms/$VMNAME
VMRUNDIR=/opt/fcs/vms/vmscratch/${USER}-$VMNAME
IMG=${VMDIR}/${VMNAME}.vdi

# Ensure .vdi exists
if [ ! -f $IMG ]
then
  missing_image
  exit
fi


if [ "$NATNETNAME" != "" ] && [ "$NATNETIP" != "" ]
then
  verify_or_create_nat $NATNETNAME $NATNETIP
fi

# Do not delete .vdi file when ran as read-write
if [ "$READWRITE" == "true" ]
then
  DELETE=""
fi

# Increase system resources if ran as Xsession
if [ "$XSESSION" == "true" ]
then
  RAM=`get_vm_ram_for_xsession`
  CPUS=`get_vm_cpus_for_xsession`
  LOG=""
fi

if [ "$LOG" == "true" ]
then
  log_start_of_vm_session
fi

# Check to make sure VirtualBox is installed
which vboxmanage > /dev/null 2>&1
if [ "$?" != "0" ]
then
  echo "VirtualBox is not available on this machine"
  exit
fi

#
# Disable Virtual check for updates
#
disable_virtualbox_upgrade_check

#
# Disable annoying pop-ups
#
disable_virtualbox_popup_messages

mkdir $VMRUNDIR
chmod 700 $VMRUNDIR

cp ${VMDIR}/${VMNAME}.vbox $VMRUNDIR

vboxmanage list vms | grep $VMNAME > /dev/null 2>&1
if [ "$?" == "0" ]
then
  echo "VM already setup"
  vboxmanage showvminfo $VMNAME | grep State
fi

vboxmanage registervm $VMRUNDIR/$VMNAME.vbox

if [ "$READWRITE" != "true" ]
then
  vboxmanage modifyhd $IMG  --type immutable
fi

# Override RAM set in .vbox
if [ "$RAM" != "" ]
then
  vboxmanage modifyvm $VMNAME --memory $RAM
fi

# Override CPU count set in .vbox
if [ "$CPUS" != "" ]
then
  vboxmanage modifyvm $VMNAME --cpus $CPUS
fi

vboxmanage storageattach "$VMNAME" --storagectl "SATA" --port 0 --device 0 --type hdd --medium $IMG

# Add FCS Homedir as a shared folder
vboxmanage sharedfolder add "$VMNAME" --name FCS-HomeDir --hostpath $HOME --automount

# Start Virtualbox
VirtualBox --comment "$VMNAME" --startvm "$VMNAME" --no-startvm-errormsgbox $FULLSCREEN

if [ "$LOG" == "true" ]
then
  log_end_of_vm_session
fi

# Remove VM configuration
vboxmanage unregistervm "$VMNAME" $DELETE

rm -Rf $VMRUNDIR
Basically creates the VM on demand and cleans it up afterwards. This is being used in lab environment.
Post Reply