8  VBoxManage  variant  Allows  to  choose  a  file  format  variant  for  the  output  file.  It  is  a  comma-separated  list  of  variant  flags.  Not  all  combinations  are  supported,  and  specifying  inconsistent  flags  will  result  in  an  error  message.  Note:  For  compatibility  with  earlier  versions  of  VirtualBox,  the  “createvdi”  command  is  also  supported  and  mapped  internally  to  the  “createhd”  command.  8.21  VBoxManage  modifyhd  With  the  modifyhd  command,  you  can  change  the  characteristics  of  a  disk  image  after  it  has  been  created:  VBoxManage  modifyhd  uuid|filename  [--type  normal|writethrough|immutable|shareable|  readonly|multiattach]  [--autoreset  on|off]  [--compact]  [--resize  megabytes|--resizebyte  bytes]  Note:  Despite  the  “hd”  in  the  subcommand  name,  the  command  works  with  all  disk  images,  not  only  hard  disks.  For  compatibility  with  earlier  versions  of  VirtualBox,  the  “modifyvdi”  command  is  also  supported  and  mapped  internally  to  the  “modifyhd”  com-  mand.  The  following  options  are  available:  •  With  the  --type  argument,  you  can  change  the  type  of  an  existing  image  between  the  normal,  immutable,  write-through  and  other  modes  see  chapter  5.4,  Special  image  write  modes,  page  76  for  details.  •  For  immutable  (differencing)  hard  disks  only,  the  --autoreset  on|off  option  determines  whether  the  disk  is  automatically  reset  on  every  VM  startup  (again,  see  chapter  5.4,  Special  image  write  modes,  page  76).  The  default  is  “on”.  •  With  the  --compact  option,  can  be  used  to  compact  disk  images,  i.e.  remove  blocks  that  only  contains  zeroes.  This  will  shrink  a  dynamically  expanding  image  again  it  will  re-  duce  the  physical  size  of  the  image  without  affecting  the  logical  size  of  the  virtual  disk.  Compaction  works  both  for  base  images  and  for  diff  images  created  as  part  of  a  snapshot.  For  this  operation  to  be  effective,  it  is  required  that  free  space  in  the  guest  system  first  be  zeroed  out  using  a  suitable  software  tool.  For  Windows  guests,  you  can  use  the  sdelete  tool  provided  by  Microsoft.  Execute  sdelete  -c  in  the  guest  to  zero  the  free  disk  space  before  compressing  the  virtual  disk  image.  Please  note  that  compacting  is  currently  only  available  for  VDI  images.  A  similar  effect  can  be  achieved  by  zeroing  out  free  blocks  and  then  cloning  the  disk  to  any  other  dynamically  expanding  format.  You  can  use  this  workaround  until  compacting  is  also  supported  for  disk  formats  other  than  VDI.  •  The  –resize  option  allows  you  to  expand  the  capacity  of  an  existing  image  this  increases  the  logical  size  of  a  virtual  disk  without  affecting  the  physical  size  much.3  This  currently  works  only  for  the  VDI  and  VHD  formats,  and  only  for  the  dynamically  expanding  variants.  For  example,  if  you  originally  created  a  10G  disk  which  is  now  full,  you  can  use  the  –resize  command  to  add  more  space  to  the  virtual  disk  without  having  to  create  a  new  image  and  copy  all  data  from  within  a  virtual  machine.  3Image  resizing  was  added  with  VirtualBox  4.0.  123  
Purchased from Demo (abedemo.tizrapublisher.com) for the exclusive use of unknown. © 2025 Demo. Please report unauthorized use to pirate@tizra.com













































































































































































































































































