Open Xeddius opened 6 years ago
You might try the SELinux settings required to run SheepShaver documented here: https://www.emaculation.com/doku.php/ubuntu and run SheepShaver as root.
@cat7 I'm on Arch/Manjaro linux, it doesn't use SELinux at all. (At least, not unless I manually install it.) The error persists even running SheepShaver as root.
@Xeddius
First, read the default minimum address that a process can map (remember this value) : cat /proc/sys/vm/mmap_min_addr
Temporarily allow mapping the NULL page with this command: sudo sysctl -w vm.mmap_min_addr="0"
Sheepshaver should now run (even without root).
When you are done, reset the default one with: sudo sysctl -w vm.mmap_min_addr="original value here"
This is a security feature, so I wouldn't make it permanent via sysctl.conf
Hey guys, No need to mess around this to enable page 0. Try different addressing mode in Linux.
For technical details, please read my wiki
If TLDR, enable direct address in configure. This alone could save you hacking around SELinux and system parm. I don't like enable page 0 in LInux unless you want to open a hole for malicious software.
Thanks for the heads up, however it crashes when I attempt the emulation. I'm getting segmentation fault right after "Reading ROM file...". I configured it with ./configure --enable-addressing=direct
.
Sorry, I misread your problem. My code analysis on addressing is based on BII. It might not work for SheepShaver. I apologized for that.
Have you tried setting "Ignore illegal memory access" to true in the preference file? There's also a "ignore illegal instructions" preference setting too. Is a preference file even created/present when you get this error?
I'm having the same issue with Sheepshaver 2.4. The "ignore illegal instructions" setting does not change things. This is on the latest Arch with the latest Sheepshaver source (master).
Using direct addressing it segfaults on the memset in line 43 of xpram.cpp, trying to initialize extended parameter RAM.
For others who run into this error: it is the page 0 problem as described in the wiki. Running as root is not an option for me. Temporarily lowering system-wide security is also problematic for obvious reasons. My fix was the following:
setcap cap_sys_rawio=ep <location_of_sheepshaver_binary>
Now only the Sheepshaver process has rights (which can be leveraged to root, so take care) to mmap() with address 0.
Thanks @schinkelg. I've also found a way to give SheepShaver the CAP_SYS_RAWIO
capability for a single execution:
sudo -E capsh --user=$USER --inh=cap_sys_rawio --addamb=cap_sys_rawio -- -c <location_of_sheepshaver_binary>
You need root to start however the SheepShaver process will actually run with as unprivileged user.
Any chance this is fixable?
Was trying (w/o success) to get SheepShaver running on Chrome OS. But I think the crostini vm is pretty restrictive in what it allows, so neither of the following work:
sudo sysctl -w vm.mmap_min_addr=0
sysctl: permission denied on key 'vm.mmap_min_addr'
setcap cap_sys_rawio=ep <location_of_sheepshaver_binary>
vm.mmap_min_addr=0
also can't be set from /etc/sysctl.conf
, nor from /etc/sysctl.d/mmap_min_addr.conf
.
I believe this is enforced w/ CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=65536
(https://www.chromium.org/chromium-os/chromiumos-design-docs/system-hardening). Or at least that sets the default, and the crostini vm (running in lxc container) can't override the vm host default (https://itectec.com/ubuntu/ubuntu-modifying-sysctl-values-inside-lxc-container/)?
Also wasn't able to get direct addressing to work.
Is it even possible for SheepShaver to be updated to not require vm.mmap_min_addr=0?
@jacobamills I'm not familiar with the inner workings of ChromeOS, but with lxc containers you still need to find a way to configure the running host kernel. Where did you try the sysctl command? It should work if ChromeOS allows it from the host... And yes, unfortunately the memory mapping is a requirement as the emulator needs to present the memory to the emulated software starting at address 0.
@Xeddius You can probably close this issue now?
Regardless of settings upon pressing start the following error appears when runing SheepShaver from terminal. (Running outside of terminal the window also disappears so I assume this error isn't terminal related.)