diff --git a/cmd/start.go b/cmd/start.go index 37f783300..5180c829f 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -117,13 +117,9 @@ func init() { defaultMountType := "9p" defaultVMType := "qemu" - if util.MacOS13OrNewer() { - defaultVMType = "vz" - defaultMountType = "virtiofs" - } - mounts := strings.Join([]string{defaultMountType, "sshfs"}, ", ") - types := strings.Join([]string{defaultVMType, "qemu"}, ", ") + mounts := strings.Join([]string{defaultMountType, "sshfs", "virtiofs"}, ", ") + types := strings.Join([]string{defaultVMType, "vz"}, ", ") root.Cmd().AddCommand(startCmd) startCmd.Flags().StringVarP(&startCmdArgs.Runtime, "runtime", "r", docker.Name, "container runtime ("+runtimes+")") @@ -171,7 +167,7 @@ func init() { // dns startCmd.Flags().IPSliceVarP(&startCmdArgs.Network.DNSResolvers, "dns", "n", nil, "DNS resolvers for the VM") - startCmd.Flags().StringSliceVar(&startCmdArgs.Flags.DNSHosts, "dns-host", nil, "Custom DNS names to provide to resolver") + startCmd.Flags().StringSliceVar(&startCmdArgs.Flags.DNSHosts, "dns-host", nil, "custom DNS names to provide to resolver") } func dnsHostsFromFlag(hosts []string) map[string]string { @@ -241,6 +237,16 @@ func prepareConfig(cmd *cobra.Command) { // convert mount type for qemu if startCmdArgs.VMType != "vz" && startCmdArgs.MountType == "virtiofs" { startCmdArgs.MountType = "9p" + if cmd.Flag("mount-type").Changed { + log.Warnln("virtiofs is only available for 'vz' vmType, using 9p") + } + } + // convert mount type for vz + if startCmdArgs.VMType == "vz" && startCmdArgs.MountType == "9p" { + startCmdArgs.MountType = "virtiofs" + if cmd.Flag("mount-type").Changed { + log.Warnln("9p is only available for 'qemu' vmType, using virtiofs") + } } } // if there is no existing settings diff --git a/embedded/defaults/colima.yaml b/embedded/defaults/colima.yaml index 22c29105f..648c63e29 100644 --- a/embedded/defaults/colima.yaml +++ b/embedded/defaults/colima.yaml @@ -104,8 +104,8 @@ docker: {} # # vz is macOS virtualization framework and requires macOS 13 # -# Default: vz (for macOS 13), qemu (for non-macOS 13) -vmType: "vz" +# Default: qemu +vmType: qemu # Volume mount driver for the virtual machine (virtiofs, 9p, sshfs). # @@ -117,7 +117,7 @@ vmType: "vz" # of concurrent reads or writes). # # Default: virtiofs (for vz), 9p (for qemu) -mountType: sshfs +mountType: 9p # The CPU type for the virtual machine (requires vmType `qemu`). # Options available for host emulation can be checked with: `qemu-system-$(arch) -cpu help`. diff --git a/environment/vm/lima/yaml.go b/environment/vm/lima/yaml.go index 374052e63..aa0e08683 100644 --- a/environment/vm/lima/yaml.go +++ b/environment/vm/lima/yaml.go @@ -222,7 +222,7 @@ func newConf(ctx context.Context, conf config.Config) (l Config, err error) { } switch strings.ToLower(conf.MountType) { - case "", "ssh", "sshfs", "reversessh", "reverse-ssh", "reversesshfs", REVSSHFS: + case "ssh", "sshfs", "reversessh", "reverse-ssh", "reversesshfs", REVSSHFS: l.MountType = REVSSHFS default: if l.VMType == VZ {