SheepShaver networking

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Post Reply
User avatar
adespoton
Forum All-Star
Posts: 4226
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

SheepShaver networking

Post by adespoton »

Lately I've been using VirtualBox with two network interfaces, and it got me to wondering: what would be involved in setting up SheepShaver so that you can have multiple network interfaces exposed at the same time?

VirtualBox has the following options that "just work":
NAT Network
Network Address Translation (NAT). If all you want is to browse the Web, download files, and view email inside the guest, then this default mode should be sufficient for you, and you can skip the rest of this section. Please note that there are certain limitations when using Windows file sharing. See Section 6.3.3, “NAT Limitations”.

NAT Network. A NAT network is a type of internal network that allows outbound connections. See Section 6.4, “Network Address Translation Service”.

Bridged networking. This is for more advanced networking needs, such as network simulations and running servers in a guest. When enabled, Oracle VM VirtualBox connects to one of your installed network cards and exchanges network packets directly, circumventing your host operating system's network stack.

Internal networking. This can be used to create a different kind of software-based network which is visible to selected virtual machines, but not to applications running on the host or to the outside world.

Host-only networking. This can be used to create a network containing the host and a set of virtual machines, without the need for the host's physical network interface. Instead, a virtual network interface, similar to a loopback interface, is created on the host, providing connectivity among virtual machines and the host.

Generic networking. Rarely used modes which share the same generic network interface, by allowing the user to select a driver which can be included with Oracle VM VirtualBox or be distributed in an extension pack.

The following sub-modes are available:

UDP Tunnel: Used to interconnect virtual machines running on different hosts directly, easily, and transparently, over an existing network infrastructure.

VDE (Virtual Distributed Ethernet) networking: Used to connect to a Virtual Distributed Ethernet switch on a Linux or a FreeBSD host. At the moment this option requires compilation of Oracle VM VirtualBox from sources, as the Oracle packages do not include it.
SS's SLIRP networking essentially provides the NAT service on a single network card. From what I can see, tuntap is similar to bridged networking.

However, you in SS you can only select one network card at a time, and there appear to be other options I've never used.

SS source indicates the following options:
SHEEPNET
ETHERTAP
TUNTAP
SLIRP
VDE

So. All this said, has anyone successfully used network options other than SLIRP and TUNTAP? And how would we go about using two at the same time?

I'd love to set up a host-only card, a basic slirp for internet access, and an internal network, where multiple VMs and emulators can communicate locally over the same bridge. At the same time.

This should provide the best of all worlds for networking, where you can communicate with the host, the internet, and other local virtual devices without all the fiddling currently needed.

From the source, it appears slirp is stand-alone, ethertap binds to /dev/<ethernetDevice>, tuntap to /dev/net/tun, sheepnet to /dev/sheep_net, and vde to the macemu.vdesock interface in libvdeplug. From what I know, sheep_net is purely a linux option at this point, and I would guess libvdeplug is Windows-only.

Anyone up to the challenge of implementing multiple ethernet cards? So you could also have ether2, ether3, ether4 and ether5 in the prefs?

Anyone up to the challenge of adding a bridge option so that, for example, ether bridge vboxnet0 would bind to bridge device vboxnet0 if it exists, sort of like qemu does it?

Just some thoughts, as people seem to be poking at the source again. This could also be useful for BII, of course.
User avatar
adespoton
Forum All-Star
Posts: 4226
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: SheepShaver networking

Post by adespoton »

Well, it's been over a year, but since we've been discussing networking lately, I thought I'd bring this back up. I'm really having headaches getting the notarized tap device to work under Catalina, but vboxnet0 "just works". Seems like it should work just as well for BII and SS as it works for VirtualBox; should work for QEMU too.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: SheepShaver networking

Post by Cat_7 »

What is your actual problem? Getting the kext to load in Catalina?
What did you try up till now?

Best,
Cat_7
User avatar
adespoton
Forum All-Star
Posts: 4226
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: SheepShaver networking

Post by adespoton »

The problems are/were legion: I've extracted the tap-notarized.kext, stuck it in the Extensions folder, chown -R root:wheel and chmod -R go-w'd the bundle, rebooted into recovery mode and deleted the cached copies with the wrong permissions, and added the tap0 device to bridge0.

However, my Macs for the most part don't have a physical NIC; they're Airport-only. So I need to bring Airport up, then add it to bridge0, in order to get a semblance of Internet access -- and then I need to pull Airport back out of bridge0 before I switch networks, bring the interface down, or do anything else.

Also, when I'm spinning up a cluster of BII and SheepShaver images for virtual networking fun, I need to remember to track which one is using which tap device and script accordingly. With vboxnet0, I've always just dumped all devices into the same pool, and they've worked fine on the single interface.

Then there's the issue with sudo -- I've scripted a privilege escalation prompt, but it's a bit annoying to use, especially as I get an authentication prompt 5 seconds after each emulator has loaded, as well as the one when it first boots.

It just seems to me that we should be able to figure out a better way to do this, creating an open tunnel that all emulators can connect to, that can be linked to dynamically. For most of my purposes, the SLIrP connection is more than enough, but it would be great to be able to pass non-TCP data packets back and forth AND access the host AND access the internet all at the same time, on multiple emulator instances.
User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

Re: SheepShaver networking

Post by mabam »

adespoton wrote: Sat Feb 23, 2019 7:55 pm SS source indicates the following options:
SHEEPNET
ETHERTAP
TUNTAP
SLIRP
VDE
VDE has been added here: https://github.com/kanjitalk755/macemu/ ... hor=Sharq7 but it seems it has to be compiled in using the --with-vdeplug switch.

I found this as I was inspired by Cat_7’s experimental QEMU build with vmnet he pointed me to: viewtopic.php?p=72383#p72383

I came across VDE_VMNET intended for providing regular QEMU builds with a vmnet framework without the requirement of running QEMU as root. At https://github.com/lima-vm/vde_vmnet#readme it says: “vde_vmnet provides vmnet.framework support for VDE applications such as QEMU”.
So I wonder whether it can also do this for SheepShaver/Basilisk II and therefore enabling layer 2 network access, which would mean AppleTalk.

As my goal is using it with SS/BII, I’m responding in this SheepShaver thread. But QEMU is how I started testing as the readme on the VDE_VMNET GitHub site is written for QEMU.

I compiled VDE_VMNET, but when starting QEMU with

Code: Select all

./qemu-system-ppc-vmnet \
-L pc-bios \
-M mac99 \
-device usb-kbd \
-device usb-tablet \
-m 128 \
-boot c \
-drive file=Mac\ OS\ 9.2.2.qcow2,format=qcow2,media=disk \
-device sungem,netdev=net0 -netdev vde,id=net0,sock=/var/run/vde.bridged.en0.ctl
I get this error:

Code: Select all

qemu-system-ppc-vmnet: -netdev vde,id=net0,sock=/var/run/vde.bridged.en0.ctl: Parameter 'type' expects a netdev backend type
(I get the same error message when using one of Cat_7’s regular QEMU builds.)

Do you guys have any ideas?
And is someone (who is preferably more an expert than I am) up for compiling SS and BII with VDE and helping to test this?
User avatar
adespoton
Forum All-Star
Posts: 4226
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: SheepShaver networking

Post by adespoton »

mabam wrote: Sun Nov 07, 2021 1:11 am
adespoton wrote: Sat Feb 23, 2019 7:55 pm SS source indicates the following options:
SHEEPNET
ETHERTAP
TUNTAP
SLIRP
VDE
VDE has been added here: https://github.com/kanjitalk755/macemu/ ... hor=Sharq7 but it seems it has to be compiled in using the --with-vdeplug switch.

I found this as I was inspired by Cat_7’s experimental QEMU build with vmnet he pointed me to: viewtopic.php?p=72383#p72383

I came across VDE_VMNET intended for providing regular QEMU builds with a vmnet framework without the requirement of running QEMU as root. At https://github.com/lima-vm/vde_vmnet#readme it says: “vde_vmnet provides vmnet.framework support for VDE applications such as QEMU”.
So I wonder whether it can also do this for SheepShaver/Basilisk II and therefore enabling layer 2 network access, which would mean AppleTalk.

As my goal is using it with SS/BII, I’m responding in this SheepShaver thread. But QEMU is how I started testing as the readme on the VDE_VMNET GitHub site is written for QEMU.

I compiled VDE_VMNET, but when starting QEMU with

Code: Select all

./qemu-system-ppc-vmnet \
-L pc-bios \
-M mac99 \
-device usb-kbd \
-device usb-tablet \
-m 128 \
-boot c \
-drive file=Mac\ OS\ 9.2.2.qcow2,format=qcow2,media=disk \
-device sungem,netdev=net0 -netdev vde,id=net0,sock=/var/run/vde.bridged.en0.ctl
I get this error:

Code: Select all

qemu-system-ppc-vmnet: -netdev vde,id=net0,sock=/var/run/vde.bridged.en0.ctl: Parameter 'type' expects a netdev backend type
(I get the same error message when using one of Cat_7’s regular QEMU builds.)

Do you guys have any ideas?
And is someone (who is preferably more an expert than I am) up for compiling SS and BII with VDE and helping to test this?
Thanks for following up on this! It's one of the myriad of things I haven't had time to look into.

"Parameter 'type' expects a netdev backend type" seems to indicate that the first netdev parameter isn't a valid type presented in the binary... which would suggest here that vde hasn't been properly enabled in the build you're running.

Documentation says:
-net vde[,vlan=n][,name=name][,sock=socketpath] [,port=n][,group=groupname][,mode=octalmode]
Connect VLAN n to PORT n of a vde switch running on host and listening for incoming connections on socketpath. Use GROUP groupname and MODE octalmode to change default ownership and permissions for communication port. This option is available only if QEMU has been compiled with vde support enabled.
Example:

Code: Select all

# launch vde switch
vde_switch -F -sock /tmp/myswitch
# launch QEMU instance
qemu linux.img -net nic -net vde,sock=/tmp/myswitch
It looks like the VDE framework solution available as you listed: https://github.com/lima-vm/vde_vmnet is so that instead of having to run a vde_switch binary every time you want to load VDE, you can just call the framework. If you run into issues triggering the framework on SS, you could try doing a manual build and run for test purposes to isolate any other issues you might be having.

The binary-based VDE has a nice writeup here: http://wiki.v2.cs.unibo.it/wiki/index.p ... Networking

The key appears to be that ALL the components being used have to be compiled with --enable-vde enabled. In their case, they're on Linux, so KDE also needs to be VDE-aware. Since we're going pure QEMU here, that shouldn't be an issue: loading the VDE.framework in userland on Catalina and later, plus enabling VDE in your QEMU-PPC build *should* be enough to get it working. Moving that to SheepShaver will require digging into what the VDE code is actually doing and how much of an interface it needs to set up inside the binary, then figuring out how Kanjitalk755 implemented it and seeing what needs to be changed (if anything).

I'd love to get this to the point where BII, SS and QEMU could all use the same VDE interface and talk to each other, the host, and the wider layer 2 network.
User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

Re: SheepShaver networking

Post by mabam »

adespoton wrote: Wed Nov 10, 2021 9:46 pm Thanks for following up on this! It's one of the myriad of things I haven't had time to look into.
You’re welcome, but your initial post was mainly about using multiple network interfaces in SheepShaver:
adespoton wrote: Sat Feb 23, 2019 7:55 pm Lately I've been using VirtualBox with two network interfaces, and it got me to wondering: what would be involved in setting up SheepShaver so that you can have multiple network interfaces exposed at the same time?
I’m not really interested in that, but it would be great to get VDE working. So it’s more about what’s relevant to me. You could say I’m selfish … :wink:

I’m playing around with Basilisk II right now. Its networking options are the same as for SheepShaver, aren’t they? So what will work for BII should also work for SS in theory?

KnuddlMac started a thread here: viewtopic.php?t=11452 about etherhelper working without a tap device for AppleTalk, but for some reason it doesn’t work in recent builds provided here on the forum. I just succeeded in a universal Basilisk II built on Catalina yesterday who's etherhelper I have tested and is working for AppleTalk (viewtopic.php?p=72763#p72763). But it is not for TCP (tested from the host), at least not when using it as an LPD print server (Cat_7’s experimental QEMU build I’ve mentioned here: viewtopic.php?p=72403#p72403 does work for this purpose).

I also want to do a build with VDE compiled in (--with-vdeplug). I just don’t know whether I will find the time to figure out how to use VDE networking.
Post Reply