From 18fb1266a2018e687c6e3d278023dbbb125df82c Mon Sep 17 00:00:00 2001 From: Jan Dubois Date: Wed, 8 Jan 2025 16:42:15 -0800 Subject: [PATCH] Don't change LD_LIBRARY_PATH when running as an AppImage Signed-off-by: Jan Dubois --- pkg/rancher-desktop/backend/lima.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pkg/rancher-desktop/backend/lima.ts b/pkg/rancher-desktop/backend/lima.ts index cc752506d0b..ca028130f20 100644 --- a/pkg/rancher-desktop/backend/lima.ts +++ b/pkg/rancher-desktop/backend/lima.ts @@ -752,13 +752,18 @@ export default class LimaBackend extends events.EventEmitter implements VMBacken const VMNETDir = path.join(VMNET_DIR, 'bin'); const pathList = (process.env.PATH || '').split(path.delimiter); const newPath = [binDir, VMNETDir].concat(...pathList).filter(x => x); + const env = structuredClone(process.env); - // LD_LIBRARY_PATH is set for running from an extracted Linux zip file, that includes QEMU, - // to make sure QEMU dependencies are loaded from the bundled lib directory, - // LD_LIBRARY_PATH is ignored on macOS. - return { - ...process.env, LIMA_HOME: paths.lima, LD_LIBRARY_PATH: libDir, PATH: newPath.join(path.delimiter), - }; + env['LIMA_HOME'] = paths.lima; + env['PATH'] = newPath.join(path.delimiter); + if (!env['APPIMAGE']) { + // LD_LIBRARY_PATH is set for running from an extracted Linux zip file, that includes QEMU, + // to make sure QEMU dependencies are loaded from the bundled lib directory, + // LD_LIBRARY_PATH is ignored on macOS. + env['LD_LIBRARY_PATH'] = libDir; + } + + return env; } protected static get qemuImgEnv() {