FileNotFoundError im LXC container

DocMAX

Member
Jan 30, 2023
179
11
18
Bremen
Habe ein ganz spezielles Problem.
Habe einen mount in meiner LXC config:
Code:
lxc.mount.entry: /mnt/pve mnt/pve none rbind,optional,create=dir
Darunter gibts vom host her einen anderen Mount (/mnt/pve/4bay). Dieser wird geerbt im LXC container angezeigt.
Code:
[docmax@desktop ~]$ file /mnt/pve/4bay/games/windows/epic/DarkDeityPdnOn/DarkDeity.exe
/mnt/pve/4bay/games/windows/epic/DarkDeityPdnOn/DarkDeity.exe: PE32+ executable (GUI) x86-64, for MS Windows, 8 sections
Allerdings sieht ein Python subprocess.Popen diese Datei nicht.
Code:
[docmax@desktop ~]$ python test.py
Error: The file '/mnt/pve/4bay/games/windows/epic/DarkDeityPdnOn/DarkDeity.exe' was not found.

Code:
[docmax@desktop ~]$ cat test.py
import subprocess
import os

exe_path = "/mnt/pve/4bay/games/windows/epic/DarkDeityPdnOn/DarkDeity.exe"

if not os.path.exists(exe_path):
    print(f"Error: The file '{exe_path}' does not exist.")
else:
    try:
        process = subprocess.Popen([exe_path], cwd=os.path.dirname(exe_path))
        process.communicate()
        print(f"Process exited with return code: {process.returncode}")
    except FileNotFoundError:
        print(f"Error: The file '{exe_path}' was not found.")
    except Exception as e:
        print(f"An error occurred: {str(e)}")

Ist das irgendwie ein Bug oder muss der Mount in der LXC config noch irgendwie angepasst werden?
 
Last edited:
Wie sehen denn die Rechte des Skriptes und der Windows exe Datei aus?
Code:
[docmax@desktop ~]$ stat test.py
  File: test.py
  Size: 799           Blocks: 9          IO Block: 1024   regular file
Device: 0,57    Inode: 4756693     Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/  docmax)   Gid: ( 1000/  docmax)
Access: 2024-08-17 12:40:54.251272156 +0200
Modify: 2024-08-17 13:01:18.735558957 +0200
Change: 2024-08-17 13:01:18.735558957 +0200
 Birth: 2024-08-17 12:42:02.929630855 +0200
[docmax@desktop ~]$ stat /mnt/pve/4bay/games/windows/epic/DarkDeityPdnOn/DarkDeity.exe
  File: /mnt/pve/4bay/games/windows/epic/DarkDeityPdnOn/DarkDeity.exe
  Size: 6978560       Blocks: 13632      IO Block: 4096   regular file
Device: 0,707    Inode: 22957209    Links: 1
Access: (0744/-rwxr--r--)  Uid: ( 1000/  docmax)   Gid: ( 1000/  docmax)
Access: 2024-01-29 16:24:15.691293316 +0100
Modify: 2023-10-17 05:03:12.989759691 +0200
Change: 2024-08-17 11:35:20.652514245 +0200
 Birth: 2023-10-17 05:03:12.969495703 +0200
 
Hmm, da es sich hier um eine Windows EXE handelt scheint hier systemd-binfmt eine Rolle zu spielen. Das läuft im LXC nicht...
 
Das wäre meine nächste Frage gewesen. Warum willst du eine Windows.exe in einem Linux-Container ausführen?
 
Das wäre meine nächste Frage gewesen. Warum willst du eine Windows.exe in einem Linux-Container ausführen?
Ja warum wohl? Ich spiele Spiele in einem LXC container (3D Ausgabe klappt mit lxc.mount.entry: /dev/dri dev/dri none rbind,optional,create=dir)
 
OK keine Ahnung wie das funktioniert oder warum man das macht .... ;)

Dein Script hat mit 0644 gar keine Rechte um ausgeführt zu werden.

Sicher dass da 0744 reicht?
File: /mnt/pve/4bay/games/windows/epic/DarkDeityPdnOn/DarkDeity.exe
Access: (0744/-rwxr--r--) Uid: ( 1000/ docmax) Gid: ( 1000/ docmax)
 
  • Like
Reactions: news
>>Dein Script hat mit 0644 gar keine Rechte um ausgeführt zu werden

Na und? Wird doch mit "python test.sh" aufgerufen... Ich glaube wenn wir uns in so einem Level unterhalten kommen wir nicht weiter.
Egal - das Problem ist gelöst. Es liegt an binfmt. Läuft nicht in LXC.
 
Na und? Wird doch mit "python test.sh" aufgerufen...
Hat mir meine Glaskugel leider nicht verraten!

Da das Problem ja nun erledigt ist (kein Proxmox Problem und vermutlich auch noch "Docker in LXC"), lassen wir das hier besser ....
 
  • Like
Reactions: noPa$$word
Hat mir meine Glaskugel leider nicht verraten!

Da das Problem ja nun erledigt ist (kein Proxmox Problem und vermutlich auch noch "Docker in LXC"), lassen wir das hier besser ....
Da braucht man keine Glaskugel. Oben steht es im Text... "[docmax@desktop ~]$ python test.py"
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!