Tuesday, April 20, 2021

The better way to get VICE on Ethernet with SELinux

Although I was a registered hardcore user of Power64 when my daily driver was still a Power Mac, now that I'm a daily Linux user on this Raptor Talos II the best Commodore 64 emulator is clearly VICE, the Versatile Commodore Emulator. It not only has highly accurate emulation, but can talk to real disk drives over OpenCBM (I use it with a ZoomFloppy xum1541) and even emulates a whole mess of peripherals, including Ethernet cartridges like the RRNet and clones (on my real Commodore 128, I use a 64NIC+).

However, I'm a Fedora user and SELinux is on by default. SELinux will really ruin your day here because it (quite reasonably) sees a random user application trying to tunnel out a network connection through libpcap/libnet as a security risk and disables it by policy. You find this out the hard way by trying to enable the Ethernet cartridge from the VICE preferences interface and getting a message you need to run it as root. I don't run things like Commodore emulators as root, spank you very much.

Fortunately, there's an easy, (probably) one time workaround; with libpcap and libnet installed (using tun/tap isn't supported yet), you will have to be root just once to fix the problem. Assuming x64sc (or whichever VICE component you're using) is in /usr/bin, you can give it raw network access with setcap cap_net_raw,cap_net_admin=eip /usr/bin/x64sc. Now you should be able to run it without root privileges and be able to access the raw interface. Here's a little test in Kipper BASIC:

Makes cross-development a lot easier!

No comments:

Post a Comment

Comments are subject to moderation. Be nice.


See more of my general vintage computing projects,
mostly microcomputers, 6502, PalmOS, 68K/Power Mac
and Unix workstations, but that's not all. Be kind, REWIND and PLAY.

Buy Me a Coffee at ko-fi.com

Old VCR is advertisement- and donation-funded, and what I get
goes to maintaining the hardware here at Floodgap.
I don't drink coffee, but the Mr Pibb doesn't buy itself. :-)
Thanks for reading. -- Cameron Kaiser