Skip to content

Commit 00fafc4

Browse files
anjannathpraveenkumar
authored andcommitted
Add config option to enable or disable shared directories
This adds a new config option 'enable-shared-dirs' for linux and macOS which will be used to control the behavior of automounting the user's $HOME dir on the crc vm during start, config type is bool and the default value is true We are adding this to provide the user an option to disable this feature if they face any issues, in our testing we found issues with RHEL 8.5 and libvirt 8.0.0 where 'crc start' errors out as: ``` level=warning msg="Failed to create the VM: virError(Code=67, Domain=10, Message='unsupported configuration: 'virtiofs' requires shared memory')" ``` This fixes #3285
1 parent ab6e30d commit 00fafc4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/crc/config/settings.go

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const (
3030
AutostartTray = "autostart-tray"
3131
KubeAdminPassword = "kubeadmin-password"
3232
Preset = "preset"
33+
EnableSharedDirs = "enable-shared-dirs"
3334
)
3435

3536
func RegisterSettings(cfg *Config) {
@@ -76,6 +77,11 @@ func RegisterSettings(cfg *Config) {
7677
"Disable update check (true/false, default: false)")
7778
cfg.AddSetting(ExperimentalFeatures, false, ValidateBool, SuccessfullyApplied,
7879
"Enable experimental features (true/false, default: false)")
80+
// shared dir is not implemented for windows yet
81+
if runtime.GOOS == "darwin" || runtime.GOOS == "linux" {
82+
cfg.AddSetting(EnableSharedDirs, true, ValidateBool, SuccessfullyApplied,
83+
"Enable shared directories which mounts host's $HOME at /home in the CRC VM (true/false, default: true)")
84+
}
7985

8086
if !version.IsInstaller() {
8187
cfg.AddSetting(NetworkMode, string(defaultNetworkMode()), network.ValidateMode, network.SuccessfullyAppliedMode,

0 commit comments

Comments
 (0)