diff --git a/src/VirtualClient/VirtualClient.Dependencies/AMDGPUDriverInstallation.cs b/src/VirtualClient/VirtualClient.Dependencies/AMDGPUDriverInstallation.cs index 59bfea9913..38cc1ec6b6 100644 --- a/src/VirtualClient/VirtualClient.Dependencies/AMDGPUDriverInstallation.cs +++ b/src/VirtualClient/VirtualClient.Dependencies/AMDGPUDriverInstallation.cs @@ -6,6 +6,7 @@ namespace VirtualClient.Dependencies using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; + using System.IO; using System.IO.Abstractions; using System.Linq; using System.Threading; @@ -200,6 +201,8 @@ private async Task InstallAMDGPUDriverLinux(EventContext telemetryContext, Cance // paths in the $PATH environment variable post installation. string bashRcPath = $"/home/{this.Username}/.bashrc"; + this.fileSystem.Directory.CreateDirectory(Path.GetDirectoryName(bashRcPath) !); + // We hit a bug where the .bashrc file does not exist on the system. To prevent issues later // we are creating the file if it is missing. if (!this.fileSystem.File.Exists(bashRcPath))