laravel / homestead

MIT License
3.86k stars 1.45k forks source link

Apple Silicon Support #1552

Closed mike85 closed 3 years ago

mike85 commented 3 years ago

Is it possible to use Homestead with Apple Silicon already?

svpernova09 commented 3 years ago

Not until Vagrant, and your provider of preference support the new chip & OS.

mike85 commented 3 years ago

Not until Vagrant, and your provider of preference support the new chip & OS.

If the providers will only support to virtualize ARM Linux images instead of x86, will settler also provide an ARM alternative to bento/ubuntu x86?

svpernova09 commented 3 years ago

Not until Vagrant, and your provider of preference support the new chip & OS.

If the providers will only support to virtualize ARM Linux images instead of x86, will settler also provide an ARM alternative to bento/ubuntu x86?

I don't know if Homestead will support ARM. The idea kinda terrifies me because I'm already managing 2 major LTS versions across 4 providers. Adding support for Apple Silicon (Assuming Vagrant & Providers get their stuff sorted out) would be a major task in Homestead.

I don't think I would build ARM support into Homestead as an open-source project. I believe the effort involved would be substantial and would require compensation. I don't even have a machine to test this on.

mike85 commented 3 years ago

Not until Vagrant, and your provider of preference support the new chip & OS.

If the providers will only support to virtualize ARM Linux images instead of x86, will settler also provide an ARM alternative to bento/ubuntu x86?

I don't know if Homestead will support ARM. The idea kinda terrifies me because I'm already managing 2 major LTS versions across 4 providers. Adding support for Apple Silicon (Assuming Vagrant & Providers get their stuff sorted out) would be a major task in Homestead.

I don't think I would build ARM support into Homestead as an open-source project. I believe the effort involved would be substantial and would require compensation. I don't even have a machine to test this on.

Thanks for the comment! Hopefully it will be possible to run x86 images on VMWare/Parallels/… one day.

svpernova09 commented 3 years ago

https://twitter.com/JoePFerguson/status/1331601928309051400

svpernova09 commented 3 years ago

https://joeferguson.me/homestead-on-apple-silicon/

asterism612 commented 3 years ago

"homestead" because your Mac is equipped with the Apple M1 chip that does not support Intel-based operating systems. To create a compatible virtual machine, use an ISO or VHDX image file with an ARM-based operating system.

svpernova09 commented 3 years ago

"homestead" because your Mac is equipped with the Apple M1 chip that does not support Intel-based operating systems. To create a compatible virtual machine, use an ISO or VHDX image file with an ARM-based operating system.

https://joeferguson.me/homestead-on-apple-silicon/

ghost commented 3 years ago

So since M1 won't be supported anytime soon and I want to get net next 16 inch M1/M2 Mac when it comes out... I am looking at alternatives already :-)

Has anyone come up with an alternative neat and clean solution yet? I thought about just setting up a VM on my server and then using something like VSCode's Remote Code Development plugin (maybe over a VPN even) but a local solution with most stuff pre-configured in Vagrant is still pretty damn nice :-)

I don't like running in Docker with something like Sail as I have some custom applications I need, which I currently install with an after.sh script.

Also, if @svpernova09 still needs around $2000 for an M1 machine, maybe we/he could setup a GoFundme or something similar. I wouldn't mind dropping $100 or more and I am sure there are plenty of Devs who want to pitch in as they might be phasing out their Intel Macs over the next 1-2 years.

dafvid commented 3 years ago

Valet works just fine on M1. Unless your coordinating with Windows users I'd go with Valet instead.

ghost commented 3 years ago

I need Linux to properly develop some stuff, hence my use of Homestead :-)

svpernova09 commented 3 years ago

Reopening this issue as it's come up again now that Parallels has shipped their M1 support.

For those that may be unaware, what "Homestead on M1 macOS" really encompasses are the following tasks:

Then we'd have a beta base box to test drive Homestead with. You'd be required to buy/use Parallels as they're currently the only of our supported providers that have shipped M1 support. I could build a packer template without an M1 system. But without it, the effort would be wasted.

I believe this would also need to be a new Vagrant base box. I don't think you can mix architectures in the same box.

Fundraising

I appreciate the support in terms of doing a fundraiser. I have some feelings about doing such during a still ongoing pandemic, but it's a possible option. I was hoping there would be a Laravel agency or group that would get value out of sponsoring such a project, but there hasn't been any interest there. Then it's up to individual contributions, How do I do that while remaining transparent about where the money is going and ensuring I'm reporting the incoming correctly to the IRS? I would gladly provide a 1099 contract to a company that wanted to do this.

When people come into this same thread where I'm asking for help, let alone the repo, and ask about / push other Homestead alternatives: that comes across to me the maintainer (me) as really crappy. You probably didn't intend it to, but it's easy to forget there's a human behind the project you're using. There are many humans behind Homestead, I'm just the one who bugged Taylor enough. Homestead isn't my full-time job. I have a full-time job + I'm involved in running several nonprofits. I'm one of the few people who maintain Laravel package(s) but don't work for Laravel. I just really love Vagrant and Virtualization.

browner12 commented 3 years ago

Once my GME moons, I'm fully funding this project, Joe. 🌕 💰

ghost commented 3 years ago

Fully understand where you are coming from @svpernova09. Honestly the only reason I asked for "alternatives" is because some other issue stated that M1 support was definitely not coming.

Let us know if you do go forwards with this and are accepting donations for M1 support. I do not currently own one but will probably switch with the next Macbook Pro's and would gladly drop some $$$ to make this happen.

dtliao0303 commented 3 years ago

Hi all,

I'm new to Homestead and Vagrant, and I'm not sure if it's okay to share this here, apologies in advance if it's not cool.

After a lot of googling I stumble upon this Homestead fork build for Apple Silicon, and works (PHP & MySQL) for me with almost no tweaking needed.

Note: it uses Parallel as the provider (paid Pro/Business edition, free base edition doesn't work with Vagrant) yodoware/homestead-arm64

I hope this helps people out who are having trouble to run Homestead on their M1 Macs, and save them lots of time. Cheers.

TjoBiZ commented 3 years ago

Yes, good idea. It's work for me too. but also I delete row with type system from config. Thnx. Will be waiting VirtualBox

adriandmitroca commented 3 years ago

Is there any update on this, @svpernova09 or the idea just got dropped completely?

svpernova09 commented 3 years ago

Is there any update on this, @svpernova09 or the idea just got dropped completely?

This issue seems to ebb and flow in interest. I've outlined what I would need to make this happen and everyone keeps telling me to crowdfund it myself. I get that a random nerd on the internet wanting people to buy them an expensive computer in exchange for building something is a big ask (and additionally harsh in a pandemic). I assumed there were agencies and companies out there using Homestead and would want to support its development. Apparently, there aren't that many focused on ARM macs or they've all moved on from Homestead. I always feel compelled to disclose that I don't work for Laravel, I don't get paid to work on Homestead. I work on Homestead because I love Linux and I want PHP developers to have a solid local development experience.

Since September 29th, 2019 (when I started tracking downloads) the base box for Homestead has been downloaded 686,396 times. That means not only did someone clone the Homestead repo, but they also ran bash init.sh to set up the box, and then they ran vagrant up at least long enough that the box downloaded was counted in Hashicorp's S3 metrics (which is what I query to get download counts) According to GitHub's Insights, Homestead Traffic continues to see ~2,000+ unique cloners per 2 weeks or so:

image

If we look at Packagist to see what packages out there are depending on Homestead, sorted by downloads shows us a picture of a user who has included Homestead in their dependencies for Laravel packages. The next listings are for a WordPress framework and phpBB itself requires laravel/homestead: ~7.0 (Really old version, likely doesn't even work)

image

I'm wondering if the inflated GitHub insights are from CICD clones, there doesn't seem to be any distinction in the UI. I find it hard to believe anyone has wired up vagrant up as part of their CICD processing. I want to believe everyone downloading the base box is Human, otherwise, that is a lot of wasted bandwidth.

Based on this information it's hard to see "who" is using Homestead. There's a number of people using Homestead as the issues here are typically pretty active and there's decent traffic in the Homestead Discord Channel of people asking questions and such.

ttmwebdesign commented 3 years ago

Hello @svpernova09 - I have two M1 Macs and am willing to be a beta tester for you. I use Homestead on my 2019 iMac and have been wanting to get it operational on my M1s but haven't had luck on my own. If you have any branches ready to offer up for testing let me know what to pull, or hit me up when they're available.

skylerkatz commented 3 years ago

@ttmwebdesign The issue at the moment is that Joe does not own an M1 machine, so he has not worked on the feature. If someone is able to provide him an M1 machine I believe he would be willing to work on an M1 version, as he stated in a recent blog post.

paulmaunders commented 3 years ago

We've just sponsored you @svpernova09, so hopefully you'll be able to get to work on this soon!

svpernova09 commented 3 years ago

We've just sponsored you @svpernova09, so hopefully you'll be able to get to work on this soon!

Wow. I'm going to spend a few minutes picking my jaw up off the floor.

svpernova09 commented 3 years ago

With the sponsorship paid here's my estimated timeline for Homestead getting an M1 release:

GitHub Sponsors pay out once a month. You can see my next payout is upcoming and should include the sponsorship!

image

Once the sponsorship makes it to the bank (or sooner) I'll place an order for an M1 machine. Given Apple just released brand new M1 systems I'll see if one of the faster machines is available in a similar price range. Otherwise, I'll roll with the plan of a 1st gen M1 Mac Mini.

Assuming all goes well and I have an M1 machine in November, I should be able to start producing builds as early as December if not sooner.

I'm excited and looking forward to working on this. Thanks for the support!

svpernova09 commented 3 years ago

Hardware has been ordered and is estimated to arrive end of the month!

Screen Shot 2021-10-21 at 15 16 15 Screen Shot 2021-10-21 at 15 16 51
svpernova09 commented 3 years ago

Should be delivered Wednesday!

image

svpernova09 commented 3 years ago

Hello everyone,

This will be the last update for this issue as the question of "Will Homestead support M1/Parallels?" has been confirmed.

I'm expecting a package later today :D and an ARM Ubuntu 20.04 template was just added to Bento (the upstream project we leverage). This means the time to build a M1 base box should be shortened from the original estimates.

Thanks to everyone for their support. Homestead is a labor of love and hearing how Homestead is helping developers makes it all worthwhile.

svpernova09 commented 3 years ago

In the spirit of full transparency here are the related transactions from the M1 purchase:

Here's my Apple Card activity. I did not have one before this purchase. I signed up for the Apple card to get the 0% financing so I didn't have any upfront out-of-pocket expenses. (Essential for keeping the wife happy).

IMG_8213

Here's the transaction from my bank where I paid the full balance of the Apple Card purchase.

image

tvillafane commented 3 years ago

Should we reopen the issue now that the funding is secured!?

svpernova09 commented 3 years ago

Should we reopen the issue now that the funding is secured!?

https://github.com/laravel/homestead/issues/1552#issuecomment-952002222

KaliaJS commented 3 years ago

@svpernova09 Thanks for you great work on Homestead. I'm surprised @taylorotwell isn't helping you financially.

svpernova09 commented 3 years ago

@svpernova09 Thanks for you great work on Homestead. I'm surprised @taylorotwell isn't helping you financially.

Taylor is one of my GitHub Sponsors :D

plakhin commented 2 years ago

I think this can be interesting: https://ubuntu.com/blog/canonical-transforms-linux-on-mac https://github.com/Fred78290/vagrant-multipass

I was using multipass on Windows and it's super nice!

vesper8 commented 2 years ago

Shouldn't https://github.com/utmapp/UTM be a possible new alternative to Virtualbox for running Homestead on M1 for free?

I understand currently Parallels is the only option for Apple Silicon, but correct me if I'm wrong, UTM does the same thing and is free and open source, so it should be a perfect candidate for Homestead on M1?

plakhin commented 2 years ago

UTM is emulation, not virtualization

fcarboneras commented 1 year ago

Since end of 2022 Virtualbox has released support for M1/M2. Maybe there is a possibility to check this for those who don't want to use Parallels.

source : https://osxdaily.com/2022/10/22/you-can-now-run-virtualbox-on-apple-silicon-m1-m2/

svpernova09 commented 1 year ago

Since end of 2022 Virtualbox has released support for M1/M2. Maybe there is a possibility to check this for those who don't want to use Parallels.

source : https://osxdaily.com/2022/10/22/you-can-now-run-virtualbox-on-apple-silicon-m1-m2/

I'm sure this looks great to the user who wants to avoid paying Parallels. Virtualbox has been nothing but a source of bugs and issues that end users blame the Homestead project on and it's certainly taken a toll on me over the years.

ICYMI: I've just spent 2-3 months trying to get a successful Virtualbox base box built for Homestead and was just finally able to make it happen by giving up on Apple and Windows completely.

I'm certainly in no hurry to start supporting another Virtualbox provider from the same company on a platform that isn't interoperable at all. Meaning: I can't build Apple Silicon on X86 systems. Thankfully an amazing Sponsor solved that issue which is what allows me to build them today, but I'm still not eager to add another base box. Especially since we're test-driving libvirt, another possible stable provider we could publish boxes for.

TL;DR

I'm in absolutely zero hurry to even install Virtualbox 7.0 on my M1 system out of fear of instability it will introduce into the homestead-arm parallels provider builds. Virtualbox 6.x was a bear of a provider because bugs would crop up in dot releases and then re-emerge again in later releases. That's not something I'm in a hurry to get back to.

pathros commented 1 year ago

@Frittenfred97 VirtualBox doesn't support 64bits machines. Hence, VirtualBox is useless on Mac Apple Silicon M1. I have just tried and it doesn't work with 64bits, just as shown in this YT (Spanish Language) video.

Regardless of using a paid software, such as Parallels, is there a (free software) way to install Laravel Homestead on a Mac Apple Silicon M1, from now on (February 2023)?

browner12 commented 1 year ago

you could try the developer preview for Apple Silicon

https://download.virtualbox.org/virtualbox/7.0.6/VirtualBox-7.0.6_BETA4-155176-macOSArm64.dmg

stebogit commented 10 months ago

I believe this is still true, as my colleague just tried to setup Homestead and failed right away when trying to install Virtual Box on an M1 Mac. Is the only option in this case to use Parallel? Is this going to ever change, or VB does not plan to have a working version for Apple's hardware?

If the latter is the case, is Laravel Sail the best alternative to Homestead? Or maybe something like Lando might be a more similar option (as in less Docker low level configuration)?

svpernova09 commented 10 months ago

I believe this is still true, as my colleague just tried to setup Homestead and failed right away when trying to install Virtual Box on an M1 Mac. Is the only option in this case to use Parallel? Is this going to ever change, or VB does not plan to have a working version for Apple's hardware?

I don't have any current plans to support VirtualBox on Apple Silicon. VirtualBox has been a total nightmare to support on Linux & Windows and I'm in no hurry to even attempt it on macOS. That could change.

If the latter is the case, is Laravel Sail the best alternative to Homestead? Or maybe something like Lando might be a more similar option (as in less Docker low level configuration)?

If you deploy to your server that runs php artisan serve, Sail is a great development environment for you. I don't deploy to this target so it doesn't make sense to develop against it.

Lando is a fantastic tool for local development that leverages Docker. I've been sponsoring them on GitHub until recently (which has nothing to do with my changing where those sponsorship dollars go). If you're using a Linux host or Windows WSL2 with Docker Desktop, you'll have a perfectly reasonable experience. On macOS, the fastest development environment is going to be Valet.

Homestead on Parallels is going to be the most stable experience for Vagrant if you want a full Linux VM. I get not wanting to buy a Parallels license. Even more so now that VMWare has been sold off.

Personally on Linux hosts I use Lando or my own configuration. On macOS hosts I use Valet, Lando, or Homestead (w/ Parallels). On Windows I reformat and install Fedora. Even WSL2 isn't enough to keep me developing on Windows. Windows 11 has had a lot to do with that.

ghost commented 10 months ago

I used Homestead for years and loved it, but switched to Sail not too long ago. I did switch it up and edited the Dockerfile so it all runs on nginx to be more aligned with my production env.

And yeah Parallels beats VirtualBox any day of the week.

pathros commented 10 months ago

I have found Laravel Herd a very nice alternative to, not only Laravel Homestead, but to Laravel Valet for Apple Silicon Mx.

Along with Laravel Herd you can use Docker for database support.

I used Laravel Homestead for many years, but since Apple Silicon I could no longer use it. Laravel Herd and Docker came to my rescue.

stebogit commented 10 months ago

Laravel Herd is not an isolated dev environment though, so if you have multiple projects using for instance different PHP versions you can't run them at the same time (I think)