Windows 10 Virtual Machine Startup, Stop, and Destroy Scripts

スポンサーリンク
スポンサーリンク

At first

Describes a script for starting, stopping, and destroying a Windows 10 virtual machine built using a script.

The script you are using is published as vm-configure on github, so please download it from github or download it from here.

See the link below for the vm-configure folder configuration.

/host-osx/windows10-start.command

This is a script for starting a Windows10 virtual machine.

The location of the script file is in the current directory.

SCRIPT_DIR=$(dirname "$0")
cd "$SCRIPT_DIR"

Re-loading bash’s default environment variables.

if [ -e "${HOME}/.bash_profile" ]; then
    . "${HOME}/.bash_profile"
fi

After changing the directory in cd "windows10" to the same location as the Vagrantfile that defined the configuration of the Windows 10 virtual machine, the virtual machine defined in the Vagrantfile is started in variant up.

cd "windows10"
vagrant up

/host-osx/windows10-stop.command

This is a script for starting a Windows10 virtual machine.

The location of the script file is in the current directory.

SCRIPT_DIR=$(dirname "$0")
cd "$SCRIPT_DIR"

Re-loading bash’s default environment variables.

if [ -e "${HOME}/.bash_profile" ]; then
    . "${HOME}/.bash_profile"
fi

Change the directory on cd "windows10" to the same location as the Vagrantfile that defined the configuration of the Windows10 virtual machine, and stop the virtual machine defined in the Vagrantfile in variant halt.

cd "windows10"
vagrant halt

/host-osx/windows10/vm-destroy.command

This is a script to destroy a Windows10 virtual machine.

The location of the script file is in the current directory.

SCRIPT_DIR=$(dirname "$0")
cd "$SCRIPT_DIR"

Re-loading bash’s default environment variables.

if [ -e "${HOME}/.bash_profile" ]; then
    . "${HOME}/.bash_profile"
fi

The execution result of the script is set to output to the file (vm-destroy.command.log) with .log after the execution script file name, and the execution start date and time are output to the log file.

exec &>>(tee "${0}.log")
date "+%Y/%m/%d %H:%M:%S"

Loading Vagrantfile in the current directory and stopping the virtual machine.

vagrant halt

Loading The Vagrantfile in the current directory and destroying the virtual machine.

vagrant destroy

Comment

スポンサーリンク