Skip to content

Instantly share code, notes, and snippets.

@auriza
Last active April 28, 2019 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save auriza/7f05e656601813bcfab98098e63fece1 to your computer and use it in GitHub Desktop.
Save auriza/7f05e656601813bcfab98098e63fece1 to your computer and use it in GitHub Desktop.
# DOWNLOAD VDI: ----------------------------------------------------------------
wget -c 'http://172.18.16.251/~adminlab/UTBK.vdi.gz'
gunzip 'UTBK.vdi.gz'
md5sum 'UTBK.vdi'
chmod o+rw 'UTBK.vdi'
# CREATE USER: -----------------------------------------------------------------
sudo adduser --add_extra_groups utbk
# CREATE VM: -------------------------------------------------------------------
sudo su - utbk
vboxmanage setproperty machinefolder ~/.vm
vboxmanage createvm --name 'utbk' --ostype 'Windows7_64' --register
vboxmanage modifyvm 'utbk' --memory 1536 --vram 32
vboxmanage storagectl 'utbk' --name 'SATA' --add sata --portcount 1
vboxmanage storageattach 'utbk' --storagectl 'SATA' --device 0 --port 0 --type hdd --medium '/home/adminlab/UTBK.vdi'
vboxmanage setextradata 'utbk' 'GUI/Fullscreen' 'on'
vboxmanage setextradata 'utbk' 'GUI/ShowMiniToolBar' 'false'
vboxmanage setextradata global 'GUI/SuppressMessages' 'all'
logout
# RUN VM: ----------------------------------------------------------------------
vboxmanage startvm 'utbk'
vboxmanage controlvm 'utbk' keyboardputscancode 0F 8F # ⭾
vboxmanage controlvm 'utbk' keyboardputscancode 0F 8F # ⭾
vboxmanage controlvm 'utbk' keyboardputscancode 0F 8F # ⭾
vboxmanage controlvm 'utbk' keyboardputscancode 0F 8F # ⭾
vboxmanage controlvm 'utbk' keyboardputscancode 1E 9E 1C 9C # A↵
vboxmanage controlvm 'utbk' keyboardputscancode 16 96 14 94 30 B0 25 A5 1C 9C # utbk↵
vboxmanage controlvm 'utbk' keyboardputscancode 40 43 58 C0 C3 D8 # F6-F9-F12
vboxmanage controlvm 'utbk' acpipowerbutton # shutdown
# AUTOLOGIN: -------------------------------------------------------------------
sudo tee /etc/lightdm/lightdm.conf << !
[Seat:*]
autologin-user=utbk
!
#sudo sed -i 's/^/#/' /etc/lightdm/lightdm.conf
# TODO: use win7 32-bit: more stable without IO-APIC, screensaver off, timezone +7
# vdi compress
# - defrag
# - sdelete.exe c: -z
# - vboxmanage modifymedium --compact '/home/adminlab/SBMPTN 2018.vdi'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment