abiosoft / colima

Container runtimes on macOS (and Linux) with minimal setup
MIT License
19.56k stars 397 forks source link

Colima requires lima to be installed with native arch #702

Open Akari0731 opened 1 year ago

Akari0731 commented 1 year ago

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

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

abiosoft commented 1 year ago

You most likely need to reset and reinstall homebrew.

therealtimhawkins commented 1 year ago

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?

abiosoft commented 1 year ago

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

therealtimhawkins commented 1 year ago

They are in /usr/local/bin

abiosoft commented 1 year ago

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.

lironrisk commented 1 year ago

reinstalling homebrew didn't solve the issue for me

gknitzberg commented 1 year ago

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

rfay commented 1 year ago

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.

uraniumdawn commented 1 year ago

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.

rfay commented 1 year ago

Yay!

bizzoni commented 1 year ago

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

hoazgazh commented 1 year ago

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 :))).

tsikora666 commented 11 months ago

Can I reinstall homebrew without losing already installed packages?

DaleTrexel commented 10 months ago

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.

roshan-abady commented 7 months ago

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!

danman01 commented 6 months ago

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)

impanda-cookie commented 4 months ago

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.