Skip to content

Commit

Permalink
core: enable binfmt only on host arch
Browse files Browse the repository at this point in the history
  • Loading branch information
abiosoft committed Nov 12, 2023
1 parent 8904b66 commit a90d23d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions environment/vm/lima/lima.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,13 @@ func (l *limaVM) addPostStartActions(a *cli.ActiveCommandChain, conf config.Conf
// cross-platform emulation
a.Add(func() error {
if !l.limaConf.Rosetta.Enabled {
// use binfmt when rosetta is disabled
return core.SetupBinfmt(l.host, l, environment.Arch(conf.Arch))
// use binfmt when rosetta is disabled and emulation is disabled i.e. host arch
if environment.HostArch() == environment.Arch(conf.Arch).Value() {
return core.SetupBinfmt(l.host, l, environment.Arch(conf.Arch))
}

// rosetta is disabled
return nil
}

// enable rosetta
Expand Down

0 comments on commit a90d23d

Please sign in to comment.