@@ -316,34 +316,36 @@ func attachConsole(_ *driver.BaseDriver, vmConfig *vz.VirtualMachineConfiguratio
316316
317317func attachFolderMounts (driver * driver.BaseDriver , vmConfig * vz.VirtualMachineConfiguration ) error {
318318 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 )
326322 if err != nil {
327323 return err
328324 }
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+ }
330331
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+ }
339340
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
344348 }
345- config .SetDirectoryShare (share )
346- mounts [i ] = config
347349 }
348350
349351 if driver .Yaml .Rosetta .Enabled {
0 commit comments