Setting up Dev Env on M1 Pro | M1 Pro 일회용 개발환경 적용기
Migration during setup is not recommended, especially if Virtualbox or other VM related things were installed
I’ve introduced how setting up disposable development environment makes for a clean workspace in the last post, but there is one caveat — it won’t work on M1, at least not verbatim.
I thought of three possible ways to approach my set up, and to stick to one of them.
- Install everything through distributed image files from official websites or App Store
- Use homebrew for M1 exclusively
- Use homebrew for x86 exclusively
This idea of sticking to one particular way of doing things actually came from this video on TDD, and one of its takeaways is not to mix mock with real data while testing. Like how test codes break at random times because of conflicting ideas about what conditions tests should cover, there will be conflicts in different approaches taken in a laptop setup — and unless you’re a hardware or software interface guru, debugging this conflict can be time-consuming.
After some trial and error, I figured it’s best to ditch using homebrew for good. The disposable environment idea provides for a minimal number of apps to be run on the host machine, after all, so it is not too hard to manage the apps.
I followed through the guide above word by word, installing everything as recommended by the provided distribution images. Then configured Vagrantfile.
Vagrant.configure("2") do |config| config.vm.box = "spox/ubuntu-arm" config.vm.box_version = "1.0.0" config.vm.hostname = "rusty-spoon" config.vm.define "rusty-spoon" config.vm.provider "vmware_desktop" do |v| # v.gui = true v.memory = "2048" v.linked_clone = false v.vmx["ethernet0.pcislotnumber"] = "160" endend
There are few things to note about this setup
- Unlike Virtualbox, you can’t setup a fixed private network IP on VMware. This is a known issue on Vagrant documentation. According to the gist thread above, some people have made it work, albeit unstable.
- Occasionally you may run into some errors about vagrant vmware utility when you run
vagrant up. This is most likely a temporary error; waiting a bit, restarting terminal / vmware etc and trying it again will work again.
vagrant upwhile connected to a hotspot may not work. I had no issue with Wifi networks, but running it after connecting to hotspot network on iPhone did not work (hangs on “Waiting for the VM to receive an address…” or some other process).