Skip to content

Use VMware Fusion Box

ppggff edited this page May 21, 2022 · 1 revision

For example: bytesguy/ubuntu-server-20.04-arm64

Steps:

  1. Add box

    vagrant box add bytesguy/ubuntu-server-20.04-arm64
    
    # choose 'vmware_fusion' and wait
    
  2. Locate the box

    # find the box dir
    find .vagrant.d/boxes -name '*bytesguy*'
    
    # enter the main dir of this box
    cd ~/.vagrant.d/boxes/bytesguy-VAGRANTSLASH-ubuntu-server-20.04-arm64/1.0.0/vmware_fusion/
    
  3. Find the disk file: *.vmdk

    # run this command with in the 'vmware_fusion' dir
    find . -name '*.vmdk'
    
    # example result:
      ./disk-s005.vmdk
      ./disk.vmdk
      ./disk-s009.vmdk
      ./disk-s008.vmdk
      ./disk-s004.vmdk
      ./disk-s003.vmdk
      ./disk-s002.vmdk
      ./disk-s001.vmdk
      ./disk-s007.vmdk
      ./disk-s010.vmdk
      ./disk-s006.vmdk
    
  4. Convert it to qcow2 image

    qemu-img convert <base of the image, without the 's00x' suffix>.vmdk new-image.qcow2
    # example: qemu-img convert disk.vmdk -O qcow2 box.qcow2
    
  5. Run local qcow2 with vagrant-qemu (see example in readme)

Notes:

  • the generated box.qcow2 can be used again for different machines
  • it's the user's response to maintain the generated box.qcow2
  • the example box may hang after vagrant up, see Fix ubuntu hang for details
Clone this wiki locally