From a944cc2bd7d879115264092534c6503e52dd9bbf Mon Sep 17 00:00:00 2001 From: asuttles Date: Wed, 16 Sep 2026 15:31:23 -0400 Subject: [PATCH 1/2] Added qemu VM instructions to Chapter 2. --- content/chapters/part1/chapter-02.md | 167 +++++++++++++++++- .../images/image-20260916-qemu-poweroff.png | Bin 0 -> 24343 bytes 2 files changed, 165 insertions(+), 2 deletions(-) create mode 100644 content/images/image-20260916-qemu-poweroff.png diff --git a/content/chapters/part1/chapter-02.md b/content/chapters/part1/chapter-02.md index 8357abd..c8e66d9 100644 --- a/content/chapters/part1/chapter-02.md +++ b/content/chapters/part1/chapter-02.md @@ -109,7 +109,9 @@ A **virtual machine** is a piece of software that lets you run FreeBSD as if it - **VirtualBox** (free and cross-platform, great for beginners). - **VMware Workstation / Fusion** (commercial, polished, widely used). -- **bhyve** (FreeBSD's native hypervisor, ideal if you want to run FreeBSD *on* FreeBSD). +- **bhyve** (FreeBSD's native hypervisor, ideal if you want to run FreeBSD *on* + FreeBSD). +- **qemu** (A generic machine emulator and virtualizer) Why developers love VMs for kernel work: @@ -437,6 +439,137 @@ Followed by the login prompt: Congratulations! Your FreeBSD lab machine is now alive and ready for configuration. +### Installing FreeBSD in VirtualBox (Step by Step) + +If you don't already have **VirtualBox** installed, you'll need to set it up before creating your FreeBSD VM. VirtualBox is available for Windows, macOS, Linux, and even Solaris hosts. Download the latest version from the official website: + +https://www.virtualbox.org/wiki/Downloads + +Choose the package that matches your host operating system (for example, Windows hosts or macOS hosts), download it, and follow the installer. The installation is straightforward and only takes a few minutes. Once it's complete, launch VirtualBox, and you'll then be ready to create your first FreeBSD virtual machine. + +Now that you are ready, let's go through the VirtualBox process, since that's the easiest entry point for most readers. The steps are similar in VMware or bhyve. + +To get started execute VirtualBox App in your computer and in the main screen select **Home** in the left column, and than click in **New**, and follow the steps below: + +### Installing FreeBSD in qemu (Step by Step) + +QEMU can run operating systems and programs for a variety of machines and architectures, using full-system emulation, user-mode emulation or virtualization. If you enjoy working at a shell prompt and qemu is available on your system, you may prefer it. If you don't already have **qemu** installed, you'll need to set it up before creating your FreeBSD VM. **qemu** is available for Windows, macOS, and Linux. You may download the latest version from the official website: + +https://www.qemu.org/download/ + +or install using your operating system's package manager. + +For linux: +```console +% sudo apt install qemu +``` + +For FreeBSD: +```console +% pkg install qemu +``` + +Now that you have installed qemu, you are ready to create your FreeBSD lab. + +1. **Create a directory for your laboratory** +```console +% mkdir ~/vm +% cd ~/vm +``` + +2. **Create a disk image for the VM** + +It is recommended to create a disk image with 30GB or more ram. + +```console +% qemu-img create -f qcow2 freebsd.img 50G +``` + +3. **Boot the FreeBSD Installer inside the VM** + +The following example creates a 64-bit x86 machine with 4 GB of RAM, 2 CPU cores, an emulated network device, and port forwarding so you can ssh into your image from a terminal in your host operating system. + +```console +% qemu-system-x86_64 \ + -m 4096 \ + -smp 2 \ + -cdrom FreeBSD-14.3-RELEASE-amd64-disc1.iso \ + -boot c \ + -drive file=freebsd.img,format=qcow2,if=virtio \ + -netdev user,id=net0,hostfwd=tcp::2222-:22 \ + -device e1000,netdev=net0 +``` + +Follow the step by step instructions in the VirtualBox FreeBSD installation sectoin above to install and configure your FreeBSD lab to the qemu image. + +After you install FreeBSD, power down the live install image using the qemu 'Machine' menu. + +![image-20260916-qemu-poweroff.png](../../images/image-20260916-qemu-poweroff.png) + +4. **Boot the FreeBSD VM** + +The command to boot the FreeBSD VM is similar to the one used for installation, but we exclude the install iso image and we do not supply the '-boot' directive so that the machine boots from the virtual drive that qemu-img created in step 1. + +```console +% qemu-system-x86_64 \ + -m 4096 \ + -smp 2 \ + -drive file=freebsd.img,format=qcow2,if=virtio \ + -netdev user,id=net0,hostfwd=tcp::2222-:22 \ + -device e1000,netdev=net0 +``` + +You can save the following script in your 'vm' folder and make it executable so that you don't have type the command every time you start your vm. + +```sh +#!/bin/sh + +# Path to your VM disk image +IMG="/home/username/vm/freebsd.img" + +# Amount of RAM +RAM=4096 + +# Number of CPUs +CPUS=2 + +# Path to QEMU executable (adjust if necessary) +QEMU=qemu-system-x86_64 + +# Network: user mode NAT + SSH forward +# Forward host port 2222 to guest port 22 +NET="-netdev user,id=net0,hostfwd=tcp::2222-:22 -device e1000,netdev=net0" + +# Boot command +$QEMU \ + -m $RAM \ + -smp $CPUS \ + -drive file="$IMG",format=qcow2 \ + $NET & +``` + +Save the above script as 'start-freebsd.sh' in your VM folder and use the following command to make it executable on your host machine. + +```console +% chmod +x start-freebsd.sh +``` + +You can now boot your FreeBSD VM lab with this simple command. + +```console +% ./start-freebsd.sh +``` + +The simple script given above uses NAT and port forwarding to allow communication between your lab and host operating system. + +Later on in this guide, you will be shown how to enable SSH in the FreeBSD guest operating system, which will allow you to log in to your running VM with the following command. + +```console +% ssh -p 2222 fbsd-user-name@localhost +``` + +Change 'fbsd-user-name' with the account name you setup when you installed FreeBSD. + ### Wrapping Up You've just completed one of the most important milestones: installing FreeBSD 14.3 on your dedicated lab environment. Whether in a VM or on bare metal, you now have a clean system that you can safely break, fix, and rebuild as you learn. @@ -952,9 +1085,10 @@ In this section, we'll explore both. ### Snapshots in Virtual Machines -If you're running FreeBSD in a VM (VirtualBox, VMware, bhyve), you have a huge safety net: **snapshots**. +If you're running FreeBSD in a VM (VirtualBox, VMware, qemu, bhyve), you have a huge safety net: **snapshots**. - In **VirtualBox** or **VMware**, snapshots are managed from the GUI, you can save, restore, and delete them with a few clicks. +- In **QEMU**, snapshots can be managed using qemu-img snapshot and overlay utilities. - In **bhyve**, snapshots are managed through the **storage backend**, usually ZFS. You snapshot the dataset that holds the VM's disk image and roll it back when needed. #### Example workflow for VirtualBox @@ -977,6 +1111,35 @@ If you're running FreeBSD in a VM (VirtualBox, VMware, bhyve), you have a huge s ![image-20250823232420760](https://freebsd.edsonbrandi.com/images/image-20250823232420760.png) +#### Example Workflow in qemu + +If your VM disk is stored in your home directory, for example '/home/xyz/vm/freebsd.img', and you want to make a 'baseline' snapshot prior to testing a new driver: + +1. Create a snapshop before experiments: + +```console +# qemu-img snapshop -c baseline /home/xyz/vm/freebsd.img +``` + +2. Make changes, test code, or even crash the kernel. + +3. Roll back instantly: + +```console +# qemu-img snapshot -a baseline /home/xyz/vm/freebsd.img +``` + +You may list all your snapshots with the -l switch: +```console +# qemu-img snapshot -l /home/xyz/vm/freebsd.img +``` + +You may delete snapshots that are no longer needed with the -d switch: + +```console +# qemu-img snapshot -d snapshot-name /home/xyz/vm/freebsd.img +``` + #### Example Workflow in bhyve (with ZFS) If your VM disk is stored on a ZFS dataset, for example `/zroot/vm/freebsd.img`: diff --git a/content/images/image-20260916-qemu-poweroff.png b/content/images/image-20260916-qemu-poweroff.png new file mode 100644 index 0000000000000000000000000000000000000000..9c18770cb07a0ca55646500d188df8e7565fed9d GIT binary patch literal 24343 zcmd43d03NI*DfBMEef?(5fP{rr51rIA~J;Fh{&V_0g<7I5@Zy@97wROP-KW@5E(EH8Q`epU@)qj+1(R)dGN*RmOs!j!u;sktxo=Wa-}YSodDS|b7p1p| zF=`$=UVpO=li>N=!8d>0+nO+(^ZnYx@Sik)I&N-;k_mrCAGJ%LSqp&Pw@d@?$g8oa!1NGyC zsKg9lBI(+zA)N$Ol`Ce}5Wc9Zof`(a06w(;#mEEw?%^ zkPz?h4R@81$^?S)a3l|{x|qmvR$cbwQRSBh7wdMyqDv>6@(~}bYt3B(kh}>6@s-fl zo>7|f2MacLH)tc)MZ{#(Xpni$!{#o*CwO;wLPkCe_P8nTmCI86@Lt3sm1Sm)bK%`b z8T-FWSBAPR3{r7c_GE`G%ZrYO&Q&&$YbOR&9hdf+ zCaal!DCxk?Y19~V9PdXzY;#+)$!Ce76kS||G`ez5km%ZDO83cUvg z^U+n;!ac_aTVtMU*kdbx17C6CWGd9x)$(s@<2#CFV0~UzPTUfOAZyGGGXE6lrgxF4 zAiN&htUIc(GMehem)u@0s?kHERfg+caCOA9P@7r_84haF+h<31(d z6Rg+9h4ZT8wWn2<7UR=(;`^%!piiII8V&Rs)|*0vp>g>-*pJ2fTX4VkRBs5@T23+z zv92G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q3K+jjS$fth&bUPp;)s#}X_0dt4YCX%JE0`V%2Whgu>yO}oZc)rtA9iX zT!-F_a))y%ASt0{MwPz50F>UH49xw)^GvdnG`qba`cFlT<=x=Qr6e{2+=2S%;%}ND z5>GZ=Da8AK{&JtskMn;N`2Qb00O%G(C$=SGpiIHX4EWhK#;>bm0cO@p`I=x=o@J~` zR-GMn2lsx$XJ4)OAeUzu^I!c1Tt@1wF=~TT9;#m*g0Og4a;Yd0`1(z!ZO|3=hUqhD zlQ#26y=VB<* zb*MFF?v`ifE~l!0dXB_0t(8@cnj6u6>@+2*sgh0x-)>bgYUm+d4GtU5e8HL<4R(uk z*$jJThaRiZTfWRo^>!VKn%|?PwN4ePV(NA(BU~zf6{fmhx(EgG)#A~a-0Q6=H58}C zVCmbZ+T+OLB-}7utS&a=O%#_iSaTO}-tW?f+pQi8Z*!BgU<}I zMx7UKlNCR{&Xdb`ohl2T#nilVT_|F`wXXi7mJ%hWva0!+TG`XrpEmu{$UCc0X2ZKn zRCdF-+vpH{LFD=xK6#0JWaS;6b0vhZQ1I?na&0ZY2fVf(ru#5v&B8b&FRhq&I^C~GgKnT+H4i9D5|E=X(8|9OIFjwU52$9E^}N~ zk-f-?2QOb*Vv)+Rmw4UYuHA6{e*0hrmxcQ*CDmnK4Q7PyU$XpdcKku6nRHtlMmXg; zv|)BJy9++%Hu?rGItborC{(l$L0q5hs!?zW|Njo``+L5e;fCG)9T&x>#lO|HvfMEc&uYB@EEr5 zG2ht<8 literal 0 HcmV?d00001 From 0dd788822670e1ed11368cf908e2d9f92b105ae5 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 16 Sep 2026 20:01:03 -0400 Subject: [PATCH 2/2] Fixed build script --highlight-style switch. --- content/chapters/part1/chapter-02.md | 41 ++++++++++------------------ scripts/build-book.sh | 6 ++-- 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/content/chapters/part1/chapter-02.md b/content/chapters/part1/chapter-02.md index c8e66d9..e42b0bf 100644 --- a/content/chapters/part1/chapter-02.md +++ b/content/chapters/part1/chapter-02.md @@ -427,30 +427,6 @@ Once FreeBSD boots, follow the same installer steps described above, where we ch After installation completes, remove the USB stick and reboot. FreeBSD will now boot from the hard drive. -### First Boot - -After installation, you'll see the FreeBSD boot menu: - -![image-20250823213050882](https://freebsd.edsonbrandi.com/images/image-20250823213050882.png) - -Followed by the login prompt: - -![image-20250823212856938](https://freebsd.edsonbrandi.com/images/image-20250823212856938.png) - -Congratulations! Your FreeBSD lab machine is now alive and ready for configuration. - -### Installing FreeBSD in VirtualBox (Step by Step) - -If you don't already have **VirtualBox** installed, you'll need to set it up before creating your FreeBSD VM. VirtualBox is available for Windows, macOS, Linux, and even Solaris hosts. Download the latest version from the official website: - -https://www.virtualbox.org/wiki/Downloads - -Choose the package that matches your host operating system (for example, Windows hosts or macOS hosts), download it, and follow the installer. The installation is straightforward and only takes a few minutes. Once it's complete, launch VirtualBox, and you'll then be ready to create your first FreeBSD virtual machine. - -Now that you are ready, let's go through the VirtualBox process, since that's the easiest entry point for most readers. The steps are similar in VMware or bhyve. - -To get started execute VirtualBox App in your computer and in the main screen select **Home** in the left column, and than click in **New**, and follow the steps below: - ### Installing FreeBSD in qemu (Step by Step) QEMU can run operating systems and programs for a variety of machines and architectures, using full-system emulation, user-mode emulation or virtualization. If you enjoy working at a shell prompt and qemu is available on your system, you may prefer it. If you don't already have **qemu** installed, you'll need to set it up before creating your FreeBSD VM. **qemu** is available for Windows, macOS, and Linux. You may download the latest version from the official website: @@ -500,11 +476,11 @@ The following example creates a 64-bit x86 machine with 4 GB of RAM, 2 CPU cores -device e1000,netdev=net0 ``` -Follow the step by step instructions in the VirtualBox FreeBSD installation sectoin above to install and configure your FreeBSD lab to the qemu image. +Follow the step by step instructions in the VirtualBox FreeBSD installation section above to install and configure your FreeBSD lab to the qemu image. After you install FreeBSD, power down the live install image using the qemu 'Machine' menu. -![image-20260916-qemu-poweroff.png](../../images/image-20260916-qemu-poweroff.png) +![image-20260916-qemu-poweroff.png](content/images/image-20260916-qemu-poweroff.png) 4. **Boot the FreeBSD VM** @@ -570,6 +546,19 @@ Later on in this guide, you will be shown how to enable SSH in the FreeBSD guest Change 'fbsd-user-name' with the account name you setup when you installed FreeBSD. +### First Boot + +After installation, you'll see the FreeBSD boot menu: + +![image-20250823213050882](https://freebsd.edsonbrandi.com/images/image-20250823213050882.png) + +Followed by the login prompt: + +![image-20250823212856938](https://freebsd.edsonbrandi.com/images/image-20250823212856938.png) + +Congratulations! Your FreeBSD lab machine is now alive and ready for configuration. + + ### Wrapping Up You've just completed one of the most important milestones: installing FreeBSD 14.3 on your dedicated lab environment. Whether in a VM or on bare metal, you now have a clean system that you can safely break, fix, and rebuild as you learn. diff --git a/scripts/build-book.sh b/scripts/build-book.sh index 114783d..a8bc0c7 100755 --- a/scripts/build-book.sh +++ b/scripts/build-book.sh @@ -550,7 +550,7 @@ build_pdf() { --variable code-block-font-size=\\footnotesize \ --variable float-placement-figure="H" \ --variable figure-placement="H" \ - --syntax-highlighting=tango \ + --highlight-style=tango \ --variable linestretch=1.15 \ --variable geometry:"inner=2cm,outer=2cm,top=2.5cm,bottom=2.5cm" \ "${font_args[@]}" \ @@ -597,7 +597,7 @@ build_epub() { --toc \ --toc-depth=2 \ --number-sections \ - --syntax-highlighting=tango \ + --highlight-style=tango \ --split-level=1 \ --verbose \ -o "$output_file" 2>&1 @@ -645,7 +645,7 @@ build_html() { --to=html5 \ --standalone \ --embed-resources \ - --syntax-highlighting=tango \ + --highlight-style=tango \ --toc \ --toc-depth=2 \ --number-sections \