colima icon indicating copy to clipboard operation
colima copied to clipboard

Colima requires lima to be installed with native arch

Open Akari0731 opened this issue 1 year ago • 17 comments

Description

Hi! After updating brew and reinstalling colima on mac, I get this error when I run colima start. limactl is running under rosetta, please reinstall lima with native arch

Could you guide me how to fix this issue? MacOS: Ventura 13.3.1 Chip: Apple M2 Homebrew: 4.0.15

Version

Colima Version: 0.5.4 Lima Version: 0.15.1 Qemu Version: 8.0.0

Operating System

  • [ ] macOS Intel <= 12 (Monterrey)
  • [ ] macOS Intel >= 13 (Ventura)
  • [ ] macOS M1 <= 12 (Monterrey)
  • [X] macOS M1 >= 13 (Ventura)
  • [ ] Linux

Output of colima status

FATA[0000] limactl is running under rosetta, please reinstall lima with native arch 
WARN[0000] error detecting Lima config directory: error retrieving lima info: exit status 1 
WARN[0000] falling back to default '$HOME/.lima'        
FATA[0000] colima is not running  

Reproduction Steps

  1. brew install colima
  2. colima start

Expected behaviour

colima start runs without any error.

Additional context

No response

Akari0731 avatar Apr 24 '23 20:04 Akari0731

You most likely need to reset and reinstall homebrew.

abiosoft avatar Apr 24 '23 21:04 abiosoft

Hi, I'm also having this issue on an M1 - Monterrey. I've tried reseting and reinstalling homebrew. Have you got any other ideas how to fix it?

therealtimhawkins avatar May 05 '23 17:05 therealtimhawkins

Do you have colima and lima installed in /usr/local/bin or /opt/homebrew/bin?

abiosoft avatar May 05 '23 18:05 abiosoft

They are in /usr/local/bin

therealtimhawkins avatar May 05 '23 19:05 therealtimhawkins

They are in /usr/local/bin

If you are using an M1 device, they should be in /opt/homebrew/bin. Maybe ensure your terminal is also native m1 app and not running in rosetta x86 emulation mode.

abiosoft avatar May 05 '23 19:05 abiosoft

reinstalling homebrew didn't solve the issue for me

lironrisk avatar May 07 '23 09:05 lironrisk

New M2; same problem; There is no $HOME/.lima folder.

FATA[0000] limactl is running under rosetta, please reinstall lima with native arch WARN[0000] error detecting Lima config directory: error retrieving lima info: exit status 1 WARN[0000] falling back to default '$HOME/.lima'
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0000] preparing network ... context=vm INFO[0001] creating and starting ... context=vm

limactl is running under rosetta, please reinstall lima with native arch FATA[0001] error starting vm: error at 'creating and starting': exit status 1

gknitzberg avatar May 11 '23 17:05 gknitzberg

If you're on an Apple Silicon machine (M1/M2), you should only have tools installed by homebrew in /opt/homebrew/bin. Nowhere else. If you have colima or limactl or qemu* or the docker client installed in /usr/local/bin, that's the problem. You must uninstall homebrew and reinstall it. You have all tools of the wrong architecture.

rfay avatar May 11 '23 17:05 rfay

I had no idea at all why this error happened.

➜  bin git:(stable) where brew
/opt/homebrew/bin/brew
➜  bin git:(stable) where lima
/opt/homebrew/bin/lima
➜  bin git:(stable) where colima
/opt/homebrew/bin/colima
➜  bin git:(stable) colima start
FATA[0000] limactl is running under rosetta, please reinstall lima with native arch
WARN[0000] error detecting Lima config directory: error retrieving lima info: exit status 1
WARN[0000] falling back to default '$HOME/.lima'
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0000] preparing network ...                         context=vm
INFO[0000] creating and starting ...                     context=vm
> limactl is running under rosetta, please reinstall lima with native arch
FATA[0000] error starting vm: error at 'creating and starting': exit status 1

But then noticed that limactl exists in the /usr/local/bin/limactl and /opt/homebrew/bin/limactl. It looks like the first one was using for start VM. Removing /usr/local/bin/limactl resolved the problem.

uraniumdawn avatar May 12 '23 10:05 uraniumdawn

Yay!

rfay avatar May 12 '23 13:05 rfay

I was facing the same issue with MAC M1 and ZSH installed. What I did to make it work:

  1. sudo nano /etc/paths -> add /opt/homebrew/bin on the top of the list
  2. restart your terminal
  3. arch -arm64 brew install lima -> This way I now have lima installed at: /opt/homebrew/bin/lima
  4. colima start

This worked for me

bizzoni avatar May 16 '23 18:05 bizzoni

I have solved this issue on my M1 Air Mac:

  1. Check the location of Homebrew path by running the command "which brew". If it shows up as "/usr/local/bin/brew", it is completely wrong. This might be because you previously used macOS on an Intel chip-based Mac Pro and then synced the OS to the M1 Mac. xD

  2. Uninstall Homebrew and then reinstall it. After reinstalling, the correct path for Homebrew should be "/opt/homebrew/bin/brew". This is the correct path.

Now, you can proceed with reinstalling the command-line interfaces (CLI) that were previously installed using the old brew path (which you deleted while uninstalling Homebrew, i mean you just have rm all bin in old brew :))).

hoazgazh avatar Jun 21 '23 03:06 hoazgazh

Can I reinstall homebrew without losing already installed packages?

tsikora666 avatar Nov 26 '23 21:11 tsikora666

I'd just like to thank everyone for this thread, and especially @abiosoft for the comment about using the appropriate terminal.

I'm upgrading from an Intel to M3 MBP and made the mistake of thinking I could just copy the .zip iTerm2 install file over from my old system and upgrade it to the latest version. That ended up putting Homebrew in /usr/local/bin instead of /opt/homebrew and ultimately generated the same error with Colima. After uninstalling Homebrew and iTerm2, then installing both properly, the error is gone and everything seems to be working.

Without this thread I would have struggled a lot longer before even considering my terminal installation as the culprit.

DaleTrexel avatar Dec 31 '23 03:12 DaleTrexel

I faced the same issue on my Mac M1 and thanks to all the above managed to resolve it. What I did was simple, no need to uninstall brew:

  1. Ran where brew, it showed up in both /usr/local/bin and /opt/homebrew/bin
  2. Opened /usr/local/bin, it contained numerous shortcuts to most of my apps
  3. Removed all shortcuts
  4. brew reinstall any that complained

Worked like a charm!

Couldn't have done it or thought of it without this thread, Thank You All!

roshan-abady avatar Mar 28 '24 19:03 roshan-abady

You may want to read this before uninstalling intel homebrew to save your old packages: port all old intel packages to new M1 homebrew by using a Brewfile: https://apple.stackexchange.com/questions/410825/apple-silicon-port-all-homebrew-packages-under-usr-local-opt-to-opt-homebrew (see accepted answer there)

danman01 avatar May 04 '24 11:05 danman01

I used M3 && solved the same issue, here's my resolution see if you guys can refer this.

1. uninstall homebrew

before you do this action, you can run which brew to check your brew path, it should be in ..../bin/brew, the full path will not include homebrew.

the you can follow the official docs to uninstall homebrew and exit the whole terminal

image

after running the uninstall script from homebrew, maybe you will encounter the warning indicate you should delete the file from xxx xxxx also.

then you can delete the homebrew files from the paths of the warning message.

2. edit /etc/paths

add /opt/homebrew/bin as the top 1 path in our /etc/paths then exit the whole terminal

3. reinstall homebrew

following the homebrew offcial site https://brew.sh/ to install the latest version of homebrew

4. install colima

run arch -arm64 brew install colima, your cmd line should start with arch -arm64, and following the guide to start you colima.

impanda-cookie avatar Jul 04 '24 12:07 impanda-cookie