The workaround of fixing bridged networking issue with Monterey

After upgrading my macOS to Monterey, my Virtualbox’s Void Linux VM can’t connect to Internet through bridged networking, though I can still connect it via SSH terminal emulator. One workaround is changing VM’s network mode to NAT, then configure “Port Forwarding” (Refer here):
(1) Goto Settings -> Network -> Advanced -> Port Forwarding:


(2) Set forwarding port:


Then “ssh user@127.0.0.1 -p2022” should work.
BTW, for my Void Linux VM, I must modify the nameserver field in /etc/resolve.conf to a public DNS server (e.g., 8.8.8.8):

nameserver 8.8.8.8

Otherwise, I will encounter “Transient resolver failure” error message.

Mount ftrace control directory on Void Linux

On Void Linux, the /sys/kernel/tracing is empty, which means the ftrace control directory is not mounted automatically, so you need mount it manually:

# mount -t tracefs nodev /sys/kernel/tracing
# cd /sys/kernel/tracing
# ls
README                      free_buffer               set_event               trace_clock
available_events            function_profile_enabled  set_event_notrace_pid   trace_marker
available_filter_functions  hwlat_detector            set_event_pid           trace_marker_raw
......

Fix “glibconfig.h: No such file or directory” error

I installed glib-devel on Void Linux, and wrote a simple program for test. But the compilation reported following error:

# gcc -I/usr/include/glib-2.0 main.c -lglib-2.0
......
/usr/include/glib-2.0/glib/gtypes.h:32:10: fatal error: glibconfig.h: No such file or directory
   32 | #include <glibconfig.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.

glibconfig.h is in /usr/lib/glib-2.0/include directory, so it should be added into header file search path:

# gcc -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include main.c -lglib-2.0
#

The c99 program on Void Linux

Today I found there is a c99 program in Void Linux:

$ c99
cc: fatal error: no input files
compilation terminated.
$ which c99
/usr/bin/c99

Check what it is:

$ file /usr/bin/c99
/usr/bin/c99: POSIX shell script, ASCII text executable
$ cat /usr/bin/c99
#!/bin/sh
exec /usr/bin/cc -std=c99 "$@"

Um, just a shell script which invokes /usr/bin/cc. So check cc program:

$ ll /usr/bin/cc
lrwxrwxrwx 1 root root 3 Jun  9 05:32 /usr/bin/cc -> gcc

Oh, a link to gcc.