Test Test
  • Home
  • Computer
  • Recipes

Disable timesync for a Virtualbox VM

Empty
  •  Print 
  • Email
Details
boehmi
computer
08 January 2019
Hits: 9073

To disable the timesync for a Virtualbox guest, run the following command on the host

vboxmanage setextradata <VMname> "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" "1"

and to re-enable

vboxmanage setextradata <VMname> "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" "0"

 

keep your virtual harddisks compact with VirtualBox

Empty
  •  Print 
  • Email
Details
boehmi
computer
04 December 2016
Hits: 10380

I wanted to share a way how to keep your VirtualBox virtual hard disks compact, without the need of manually "zeroing" the free space in your VM and running

 VBoxManage modifyhd ... --compact

afterwards.

 

It only works if your virtual harddisks are stored on an SSD drive and if they are in VDI format. First you have to remove the hard disk from your virtual machine. DON'T DELETE the hard disk, only remove it. Then you attach it from the command line with the following command

VBoxManage storageattach "NameOfVM" --storagectl "SATA" --port 0 --device 0 --nonrotational on --discard on --medium "/path/to/harddisk.vdi" --type hdd

"Port 0" is the first SATA controller and "device 0" is the first hard disk of your VM. Change these values if necessary as well as "/path/to/harddisk.vdi". This command adds the discard="true" to your settings in the *.vbox file. When I tried to add this manually to the *.vbox file, it didn't work and this entry got deleted by VB on the next start.

If you mount your filesystems with the "discard" option, deleted sectors will be automatically trimmed and thus the vdi shrinks automatically too. Otherwise you have to run "fstrim" for each mounted filesystem manually or via a cronjob.

checking whether a URL is reachable

Empty
  •  Print 
  • Email
Details
boehmi
scripts
21 February 2016
Hits: 12177
ERROR=1
URL="$1"
EMAIL=""
SLEEP="300"
while [ $ERROR -gt 0 ]
do
wget -T 10 -t 1 --spider "$URL";ERROR=$?;sleep $SLEEP;done;mail -s "website is back" $EMAIL < /dev/null
done

Variables in a Skype script

Empty
  •  Print 
  • Email
Details
boehmi
computer
06 March 2016
Hits: 13302

Update: this doesn't work anymore since Microsoft updated Skype a while ago

 

The following variables can be used when executing a script on a Skype event

Notification type: %type
Username: %sskype
Contact name: %sname
Message Contents: %smessage
File name: %fname
File path: %fpath
File size: %fsize

Read more: Variables in a Skype script

Subcategories

scripts

Most Read

  • Variables in a Skype script
  • welcome
  • checking whether a URL is reachable
  • Pizza dough
  • keep your virtual harddisks compact with VirtualBox

Latest Articles

  • Disable timesync for a Virtualbox VM
  • keep your virtual harddisks compact with VirtualBox
  • Variables in a Skype script
  • welcome
  • checking whether a URL is reachable
Bootstrap is a front-end framework of Twitter, Inc. Code licensed under MIT License. Font Awesome font licensed under SIL OFL 1.1.