@@ -11,14 +11,17 @@ import (
11
11
"fmt"
12
12
"net"
13
13
"path/filepath"
14
+ "runtime"
14
15
"time"
15
16
16
17
"github.com/Code-Hex/vz/v3"
18
+ "github.com/coreos/go-semver/semver"
17
19
18
20
"github.com/sirupsen/logrus"
19
21
20
22
"github.com/lima-vm/lima/pkg/driver"
21
23
"github.com/lima-vm/lima/pkg/limayaml"
24
+ "github.com/lima-vm/lima/pkg/osutil"
22
25
"github.com/lima-vm/lima/pkg/reflectutil"
23
26
)
24
27
@@ -80,11 +83,18 @@ func New(driver *driver.BaseDriver) *LimaVzDriver {
80
83
}
81
84
82
85
func (l * LimaVzDriver ) Validate () error {
83
- // Calling NewEFIBootLoader to do required version check for latest APIs
84
- _ , err := vz .NewEFIBootLoader ()
85
- if errors .Is (err , vz .ErrUnsupportedOSVersion ) {
86
+ macOSProductVersion , err := osutil .ProductVersion ()
87
+ if err != nil {
88
+ return err
89
+ }
90
+ if macOSProductVersion .LessThan (* semver .New ("13.0.0" )) {
86
91
return errors .New ("VZ driver requires macOS 13 or higher to run" )
87
92
}
93
+ if runtime .GOARCH == "amd64" && macOSProductVersion .LessThan (* semver .New ("15.5.0" )) {
94
+ logrus .Warnf ("vmType %s: On Intel Mac, macOS 15.5 or later is required to run Linux 6.12 or later. " +
95
+ "Update macOS, or change vmType to \" qemu\" if the VM does not start up. (https://github.com/lima-vm/lima/issues/3334)" ,
96
+ * l .Instance .Config .VMType )
97
+ }
88
98
if * l .Instance .Config .MountType == limayaml .NINEP {
89
99
return fmt .Errorf ("field `mountType` must be %q or %q for VZ driver , got %q" , limayaml .REVSSHFS , limayaml .VIRTIOFS , * l .Instance .Config .MountType )
90
100
}
0 commit comments