简体   繁体   English

RPi 4B 4G 32 位操作系统上的 qemu-x86_64

[英]qemu-x86_64 on RPi 4B 4G 32-bit OS

I am attempting to run x86_64 playonlinux on my RPi 4B, with qemu-x86_64.我正在尝试使用 qemu-x86_64 在我的 RPi 4B 上运行 x86_64 playonlinux。 I am on a 32-bit OS.我在 32 位操作系统上。 Here is the error when running it:这是运行它时的错误:

(xenial-amd64)pi@raspberrypi44g:~/chroots/64-bit-x86 $ playonlinux        
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Looking for python... 2.7.12 - wxversion(s): 3.0-gtk2
selected
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
[main] Message: PlayOnLinux (4.2.10) is starting
[clean_tmp] Message: Cleaning temp directory
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
[Check_OpenGL] Warning: check_dd_x86 missing, test skipped
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
[Check_OpenGL] Warning: check_dd_amd64 missing, test skipped
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
[POL_System_CheckFS] Message: Checking filesystem for /home/pi/.PlayOnLinux/
[main] Message: Filesystem is compatible
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

(mainwindow.py:12318): Gdk-WARNING **: shmat failed: error 22 (Invalid argument)
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/usr/share/playonlinux/playonlinux: line 126: 12318 Bus error               "$POL_PYTHON"             mainwindow.py "$@"
(xenial-amd64)pi@raspberrypi44g:~/chroots/64-bit-x86 $ [update_check] Message: List is up     to date
[install_plugins] Message: Checking plugin: ScreenCap...
[install_plugins] Message: Checking plugin: PlayOnLinux Vault...

(xenial-amd64)pi@raspberrypi44g:~/chroots/64-bit-x86 $ 

What causes this error?是什么导致了这个错误?

There are several possible causes here, but in general QEMU's user-mode emulation is far from perfect and it's probably better not to expect that it will be able to run large and complicated pieces of software, especially something like PlayOnLinux, which AFAICT is based on Wine.这里有几个可能的原因,但总的来说 QEMU 的用户模式仿真远非完美,最好不要期望它能够运行大型和复杂的软件,尤其是像 AFAICT 所基于的 PlayOnLinux 这样的软件葡萄酒。 (The user-mode emulation is not very high on the effective priority list of the QEMU developer community, in the sense that there are not many developers who are either paid to work on that part of the code or who work on it out of personal interest, compared to other areas like system-emulation or KVM support.) (用户模式仿真在 QEMU 开发者社区的有效优先级列表中不是很高,因为没有多少开发者要么有偿从事该部分代码工作,要么出于个人目的而工作兴趣,与系统仿真或 KVM 支持等其他领域相比。)

I'll start with an item zero, which is that you don't say what QEMU version you're using.我将从第 0 项开始,即您没有说明您使用的是哪个 QEMU 版本。 If it's not the most recent version, you could try a newer QEMU and see if it helps.如果它不是最新版本,您可以尝试更新的 QEMU 看看它是否有帮助。

First on the list of possible causes: QEMU's user-mode doesn't support 64-bit guests on 32-bit hosts.首先列出可能的原因:QEMU 的用户模式不支持 32 位主机上的 64 位来宾。 We make a best effort, which works for simple programs, but is likely to fail for more complicated ones.我们尽最大努力,这适用于简单的程序,但对于更复杂的程序可能会失败。 You could test whether this is the problem by seeing whether the program runs on a 64-on-64 combination like x86-64-on-aarch64.您可以通过查看程序是否在 x86-64-on-aarch64 这样的 64-on-64 组合上运行来测试这是否是问题所在。

Secondly, our x86-64 emulation doesn't cover more recent additions to the x86 instruction set like AVX;其次,我们的 x86-64 仿真不涵盖 x86 指令集(如 AVX)的最新添加; if the guest program assumes it can use those then it will crash or misbehave when run under QEMU.如果来宾程序假设它可以使用它们,那么它在 QEMU 下运行时会崩溃或行为不端。 (The errors here look like they're probably not this.) (这里的错误看起来可能不是这个。)

Thirdly, we might be missing or have bugs in the implementation of particular system calls or other features of the Linux ABI.第三,我们可能在 Linux ABI 的特定系统调用或其他功能的实现中遗漏或存在错误。

Fourthly, the x86 memory model is stricter than the Arm one, and QEMU's emulation doesn't try to compensate for this. Fourthly, the x86 memory model is stricter than the Arm one, and QEMU's emulation doesn't try to compensate for this. So a multithreaded guest program might run into issues here if you're unlucky.因此,如果您不走运,多线程来宾程序可能会在这里遇到问题。

Tracking down which of these might be the case for this particular guest binary would require an extended debugging session where you look at what the guest is doing at the point where it fails (for instance, why does the shmat() fail? What is the immediate cause of the bus error?) and then trying to track back to what happened using a combination of the source for the guest, disassembly/reverse-engineering of the guest binary, and the source for QEMU.跟踪此特定来宾二进制文件中可能出现的情况将需要扩展调试 session,您可以在其中查看来宾在失败时正在做什么(例如,为什么 shmat() 失败?什么是总线错误的直接原因?),然后尝试结合使用来宾源、来宾二进制文件的反汇编/逆向工程以及 QEMU 的源来追溯发生了什么。 (If this sounds to you like it's a difficult and long process, you're not wrong:-)) (如果这听起来对你来说是一个艰难而漫长的过程,你没有错:-))

Side note: the combination of "shmat fails" plus "bus error" on a graphical program makes me wonder if your setup is using a remote X session (DISPLAY set to something other than a local X server) and the guest program itself is buggy and not able to successfully fall back to a code path that doesn't use the X shared memory extension.旁注:图形程序上的“shmat失败”加上“总线错误”的组合让我想知道您的设置是否使用远程X session(显示设置为本地X服务器以外的其他内容)并且来宾程序本身是错误的并且无法成功回退到不使用 X 共享 memory 扩展的代码路径。 You could test that by running the guest natively on an x86-64 host with a non-local DISPLAY setting, or by arranging to have a local X server on your Arm host.您可以通过在具有非本地 DISPLAY 设置的 x86-64 主机上本地运行来宾来测试这一点,或者通过在 Arm 主机上安排本地 X 服务器来测试。

It works, but not great.它有效,但不是很好。 Use an x86_64 host system if you can.如果可以,请使用 x86_64 主机系统。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 QEMU android aarch64 作为主机。 来宾 32 位 x86 或 x86_64 哪个会更快? - QEMU android aarch64 as host. Which will be faster as guest 32-bit x86 or x86_64? 使用 g++ -march=x86-64 构建的代码可以在 32 位操作系统上运行吗? - Can code built with g++ -march=x86-64 run on a 32-bit Operating System? 带有 x86-64 ISA 的 32 位指针:为什么不呢? - 32-bit pointers with the x86-64 ISA: why not? 64 位模式下的 x86-64 地址计算,具有 32 位地址大小 - x86-64 address calculation in 64bit mode with 32-bit address-size ptrace 能否判断 x86 系统调用使用的是 64 位还是 32 位 ABI? - Can ptrace tell if an x86 system call used the 64-bit or 32-bit ABI? 为什么32位应用程序可以在64位x86 CPU上运行? - Why do 32-bit applications work on 64-bit x86 CPUs? 在 64 位 (x86-64) 机器上构建 32 位 (x86) gcc-10.2.0 时出错 - Error building 32-bit (x86) gcc-10.2.0 on a 64-bit (x86-64) machine 构建apr-util 64位Mac OS X构建32位版本 - building apr-util 64 bit Mac OS X builds 32-bit version (汇编新手)无法从GDB访问x86-64中的32位寄存器 - (Assembly newbie) Unable to access 32-bit registers in x86-64 from GDB 为什么 32 位寄存器上的 x86-64 指令将整个 64 位寄存器的上半部分归零? - Why do x86-64 instructions on 32-bit registers zero the upper part of the full 64-bit register?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM