@@ -316,34 +316,36 @@ func attachConsole(_ *driver.BaseDriver, vmConfig *vz.VirtualMachineConfiguratio
316
316
317
317
func attachFolderMounts (driver * driver.BaseDriver , vmConfig * vz.VirtualMachineConfiguration ) error {
318
318
mounts := make ([]vz.DirectorySharingDeviceConfiguration , len (driver .Yaml .Mounts ))
319
- for i , mount := range driver .Yaml .Mounts {
320
- expandedPath , err := localpathutil .Expand (mount .Location )
321
- if err != nil {
322
- return err
323
- }
324
- if _ , err := os .Stat (expandedPath ); errors .Is (err , os .ErrNotExist ) {
325
- err := os .MkdirAll (expandedPath , 0750 )
319
+ if * driver .Yaml .MountType == limayaml .VIRTIOFS {
320
+ for i , mount := range driver .Yaml .Mounts {
321
+ expandedPath , err := localpathutil .Expand (mount .Location )
326
322
if err != nil {
327
323
return err
328
324
}
329
- }
325
+ if _ , err := os .Stat (expandedPath ); errors .Is (err , os .ErrNotExist ) {
326
+ err := os .MkdirAll (expandedPath , 0750 )
327
+ if err != nil {
328
+ return err
329
+ }
330
+ }
330
331
331
- directory , err := vz .NewSharedDirectory (expandedPath , ! * mount .Writable )
332
- if err != nil {
333
- return err
334
- }
335
- share , err := vz .NewSingleDirectoryShare (directory )
336
- if err != nil {
337
- return err
338
- }
332
+ directory , err := vz .NewSharedDirectory (expandedPath , ! * mount .Writable )
333
+ if err != nil {
334
+ return err
335
+ }
336
+ share , err := vz .NewSingleDirectoryShare (directory )
337
+ if err != nil {
338
+ return err
339
+ }
339
340
340
- tag := fmt .Sprintf ("mount%d" , i )
341
- config , err := vz .NewVirtioFileSystemDeviceConfiguration (tag )
342
- if err != nil {
343
- return err
341
+ tag := fmt .Sprintf ("mount%d" , i )
342
+ config , err := vz .NewVirtioFileSystemDeviceConfiguration (tag )
343
+ if err != nil {
344
+ return err
345
+ }
346
+ config .SetDirectoryShare (share )
347
+ mounts [i ] = config
344
348
}
345
- config .SetDirectoryShare (share )
346
- mounts [i ] = config
347
349
}
348
350
349
351
if driver .Yaml .Rosetta .Enabled {
0 commit comments