Running tutorial on Apple silicon

95 views
Skip to first unread message

Kentaro Ebisawa

unread,
Jun 2, 2024, 7:19:07 AMJun 2
to p4-di...@lists.p4.org
Hi,

Did anyone successfully ran plang/tutorials on Apple silicon Mac? (e.g. MBP)

https://github.com/p4lang/tutorials/blob/master/README.md

Virtual Box is no more supported on Apple silicon (if I understand correctly) so wondering if there are any other quick way to run this on my Mac Book Pro.

(We are having P4 hands on workshop in Tokyo next week, so would be nice to have it handy on my laptop in case of any network issues)

Thanks,
-- 
Kentaro Ebisawa <ebik...@gmail.com>

Nate Foster

unread,
Jun 2, 2024, 7:45:02 AMJun 2
to Kentaro Ebisawa, p4-di...@lists.p4.org
I haven’t tried this but you should be able to run the existing x86 VM in emulation using UTM. It certainly won’t be fast, but if you allocate enough RAM, should be usable.

Another idea would be to use a Docker container. We did this for the network testing tutorial at SIGCOMM ‘23 and it worked pretty well.

-N

--
You received this message because you are subscribed to the Google Groups "p4-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to p4-discuss+...@lists.p4.org.
To view this discussion on the web visit https://groups.google.com/a/lists.p4.org/d/msgid/p4-discuss/650DA4C9-B15B-4813-9737-095C57DA2060%40gmail.com.

Kentaro Ebisawa

unread,
Jun 2, 2024, 10:12:24 PMJun 2
to Nate Foster, p4-di...@lists.p4.org
Thanks Nate for the input.

Do you have pointer to the Docker container used in SIGCOMM’23 tutorial?

I did try using UTM + Ubuntu 24.04/20.04 (both server and desktop) + vm-ubuntu-20.04 but failed during `vagrant up` and still trying to debug.

-- 
Kentaro Ebisawa <ebik...@gmail.com>

Nate Foster

unread,
Jun 3, 2024, 1:59:23 AMJun 3
to Kentaro Ebisawa, p4-di...@lists.p4.org
Weird about UTM. It’s worked well (if slowly) for me.


-N

Fabian Ruffy

unread,
Jun 3, 2024, 8:29:33 AMJun 3
to p4-di...@lists.p4.org

There is also Andy's installation scripts. The scripts also should support running the tutorials on the M1 MacOS: https://github.com/jafingerhut/p4-guide/blob/master/bin/README-install-troubleshooting.md#which-install-script-should-i-use

I do not know whether they also include support for a VM hosted using UTM.

Fabian

Nate Foster

unread,
Jun 3, 2024, 8:38:12 AMJun 3
to Fabian Ruffy, p4-di...@lists.p4.org
It might work to build p4c and even Bmv2 on Mac silicon, but I don't think Mininet will run as intended on Mac OS. You need Linux and in particular network namespaces.

-N

Andy Fingerhut

unread,
Jun 5, 2024, 12:53:06 AMJun 5
to Nate Foster, Fabian Ruffy, p4-di...@lists.p4.org
My installation scripts have been tested on an Apple Silicon Mac running macOS, running UTM, and then inside UTM run an Ubuntu 20.04, 22.04, or 24.04 Linux VM (with aarch64 processor architecture, not x86_64/amd64).  The P4 open source development tools are compiled completely within that Linux VM, and only run inside there.  If you do not run UTM and a Linux VM, my scripts won't help you build and run the P4 tools in macOS directly.

Andy

Andy Fingerhut

unread,
Jun 5, 2024, 12:54:03 AMJun 5
to Nate Foster, Fabian Ruffy, p4-di...@lists.p4.org
One more small addition I forgot to mention before: mininet is included in the software installed within my Linux VMs, enabling you to run all of the exercises in p4lang/tutorials.

Andy
Reply all
Reply to author
Forward
0 new messages