Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Thanks, will read it. The first time I tried vftool the VM crashed often. I followed https://iphonesdkdev.blogspot.com/2020/12/20201202.html. Are VMs started with vftool stable for you?
Try using vftool with image, kernel, and initrd from mikeboss's zip. It worked for me and it is persistent. I expanded the size of the image to 100 gb to make it more useful for my needs. I also set the ip of the VM to static so I don't have to update docker context every time I restart the VM.

I run vftool using this: ./vftool -k vmlinuz -i initrd -d image3 -m 4096 -a "root=/dev/vda console=hvc0"
 
Last edited:
Hi Everyone!

Quick question: is there anyway of getting the Windows virtual machine to work in a single app package? I.e, without installing homebrew and such?
 
Try using vftool with image, kernel, and initrd from mikeboss's zip. It worked for me and it is persistent. I expanded the size of the image to 100 gb to make it more useful for my needs. I also set the ip of the VM to static so I don't have to update docker context every time I restart the VM.

I run vftool using this: ./vftool -k vmlinuz -i initrd -d image3 -m 4096 -a "root=/dev/vda console=hvc0"

Is there a reliable list step by step to get this setup working? I just tried vftool following a few other posts and again he VM crashes randomly :(
 
Try using vftool with image, kernel, and initrd from mikeboss's zip. It worked for me and it is persistent. I expanded the size of the image to 100 gb to make it more useful for my needs. I also set the ip of the VM to static so I don't have to update docker context every time I restart the VM.

I run vftool using this: ./vftool -k vmlinuz -i initrd -d image3 -m 4096 -a "root=/dev/vda console=hvc0"
Just tried with those files, same crashes :(
 
to be honest, I don't do any serious work with it. but I played around with vftool and SimpleVM quite a bit over the last two weeks and so far I haven't seen a single crash.

I can't get it to work stably with vftool but the VM seems stable with SimpleVM. How do I resize the image? Thanks!
 
I am a recent convert to Mac/Linux from Windows so can't help much with the error. What I can do is, if you DM me a shared cloud location, I can drop my build of vftool along with the initrd file and kernel that you can use with the image file mike boss has provided - https://github.com/mibosshard/SimpleVM/releases/download/20201128/SimpleVM_Ubuntu.zip

Put the image and the files I provide in the same directory and just run the following from terminal -
./vftool -k vmlinuz -i initrd -d image -m 4096 -a "root=/dev/vda console=hvc0"

Details on how to expand the image - https://superuser.com/questions/693158/can-i-expand-the-size-of-a-file-based-disk-image (the accepted answer). Skip the first step since you already have the image and you don't need to create it.

For the step '# dd if=/dev/zero bs=1M count=400 >> ./binary.img' this is to expand by 400MB. Change 400 to a size you want. I went with 100000 (~100 GB)

To resize you either need a linux machine or windows with WSL. Another option is to share a folder on your MacBook, mount it in Linux (google mounting smb share in Linux) and then run through the steps to expand the image. Create a copy of the image file so you do not manipulate the image file that is running the Linux VM.
 
I am a recent convert to Mac/Linux from Windows so can't help much with the error. What I can do is, if you DM me a shared cloud location, I can drop my build of vftool along with the initrd file and kernel that you can use with the image file mike boss has provided - https://github.com/mibosshard/SimpleVM/releases/download/20201128/SimpleVM_Ubuntu.zip

Put the image and the files I provide in the same directory and just run the following from terminal -
./vftool -k vmlinuz -i initrd -d image -m 4096 -a "root=/dev/vda console=hvc0"

Details on how to expand the image - https://superuser.com/questions/693158/can-i-expand-the-size-of-a-file-based-disk-image (the accepted answer). Skip the first step since you already have the image and you don't need to create it.

For the step '# dd if=/dev/zero bs=1M count=400 >> ./binary.img' this is to expand by 400MB. Change 400 to a size you want. I went with 100000 (~100 GB)

To resize you either need a linux machine or windows with WSL. Another option is to share a folder on your MacBook, mount it in Linux (google mounting smb share in Linux) and then run through the steps to expand the image. Create a copy of the image file so you do not manipulate the image file that is running the Linux VM.

Is there a way to resize the image on Mac? I don't have access to a Linux machine.

fresh release of a turn-key ready image:

vftool binary
Ubuntu 20.04.1 LTS


Thanks Mike, will try it right away! Same question for you, how do I resize this image on Mac?
 
fresh release of a turn-key ready image:

vftool binary
Ubuntu 20.04.1 LTS

Mike, how do you figure out root mount point for an image? I tried root=/dev/vda (and vda1) for images downloaded from Ubuntu, but it didn’t work for those images.
 
It looks like the way I was resizing the disk before was screwing up something. With @agrawalp86's command even on Mac it worked with slightly different syntax and I am not seeing kernel panics anymore so far. However some stuff is missing in the image so I am having problems installing Docker because of missing modules. Have you guys run into this too?
 
It looks like the way I was resizing the disk before was screwing up something. With @agrawalp86's command even on Mac it worked with slightly different syntax and I am not seeing kernel panics anymore so far. However some stuff is missing in the image so I am having problems installing Docker because of missing modules. Have you guys run into this too?
I used these guides for setting up docker, in case it helps -
 
@mikeboss the previous image with cloud init etc seems to have the modules for iptables, but I get "iptables/1.8.5 Failed to initialize nft: Protocol not supported". What else was removed from that image? Thanks
 
Mike, how do you figure out root mount point for an image? I tried root=/dev/vda (and vda1) for images downloaded from Ubuntu, but it didn’t work for those images.

that is strange... "root=/dev/vda" has always worked for me. I didn't figure it out, IIRC bruce hoult gave me the hint.
github.com/brucehoult/SimpleVM
 
I'm doing it on a Linux box. I know there are ways to achieve this using the dd command on macOS. but never tried it so far.
Thanks for the hint there Mike.

VitoBotta - this command will expand the image file to 100 GB. Change 100000MB to the value you want. I just tried it on my Mac and it worked fine.

dd if=/dev/zero bs=1m count=100000 >> ./image
 
the previous image with cloud init etc seems to have the modules for iptables, but I get "iptables/1.8.5 Failed to initialize nft: Protocol not supported". What else was removed from that image? Thanks

I didn't remove anything besides the packages mentioned in the release notes from today.
github.com/mibosshard/vftool/releases/tag/20201210

because the cloud stuff usually would initialize the network we now have to edit
/etc/netplan/01-dhcp.yaml
manually.

DHCP:
Code:
network:
    renderer: networkd
    ethernets:
        enp0s1:
            dhcp4: true
    version: 2

or, for a fixed IP address:
Code:
network:
    ethernets:
        enp0s1:
            dhcp4: false
            addresses: [192.168.64.2/24]
            gateway4: 192.168.64.1
            nameservers:
              addresses: [1.1.1.1]
    version: 2



-
 
Last edited:
if one still has an intel Mac around: multipass from canonical comes with "qemu-img" which is what I use to resize the Ubuntu images. the installer places the command in

/Library/Application\ Support/com.canonical.multipass/bin/qemu-img

 
that is strange... "root=/dev/vda" has always worked for me. I didn't figure it out, IIRC bruce hoult gave me the hint.
github.com/brucehoult/SimpleVM
Oh okay, I got the idea of trying vda1 from one of his tweets as well. I'll try researching more on this.
 
new release of vftool!

V 0.3 brings the ability to attach up to 8 disk images. also, this is a Universal Binary (it runs on Intel and Apple Silicon Macs).

thnx to Matt Evans @AtTheHackOfDawn

 
  • Like
Reactions: pippox0
I created this detailed walkthrough for using vftool to setup a VM from scratch without the need for a Linux machine -
I created this for purposes of installing docker but the VM setup part is generic.

nice walkthrough! I think you should ommit "root=/dev/vda1" here:
Screen Shot 2020-12-12 at 21.38.50.png
 
  • Like
Reactions: jdb8167
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.