r/freebsd • u/grahamperrin • 11d ago
poll FreeBSD Project goals
The FreeBSD Project began more than three decades ago. Now:
- how many goals does it have?
Please refrain from comments until after closure of the poll. Thank you …
r/freebsd • u/grahamperrin • 4d ago
news FreeBSD 14.1-BETA2: please test
mail-archive.freebsd.orgr/freebsd • u/the_humeister • 23h ago
Cleaning out the living quarters and found some CDs from back when I had dial-up internet.
r/freebsd • u/nskeip • 17h ago
Setting up for backend development: Docker in 3 steps
As a web developer in a team that uses Docker extensively, I found it hard to start using FreeBSD as a daily driver.
But I found a solution. Here is how you can run Docker-based projects:
- Create a bhyve VM with Alpine Linux (check out a video by Marko Tasic). Plus install docker and all the stuff you normally need to run your project on Linux.
- Share your "projects" directory (well, that's where your projects are located as subdirectories) with the VM using NFS (check out the Handbook). Mount it in your VM.
- When the "projects" directory mounted, run docker or docker-compose from propper subdirectories.
And that's it. You run Docker-based projects on FreeBSD!
r/freebsd • u/loziomario • 2d ago
article How to copy files easy and fast to a NTFS (or EXT*) formatted disk without using the (almost broken in FreeBSD) fusefs(-ext2 or ntfs) driver.
Hello.
Here is another How-To I wrote because I wanted to avoid the risk to corrupt the disk while I copy files from a disk (UFS or ZFS) to my NTFS (or even EXT*) formatted disks. This happens because the driver used in FreeBSD does not work well (fusefs-ntfs) ; the same happens with the ext2 driver (fusefs-ext2). My idea is to use a Linux vm as a bridge to copy files to a ntfs or ext* disk and placed it in background and when we did the copy, kill that vm. Since Linux has a good ext*,zfs and ntfs drivers,using this tecnique will reduce to almost 0 the risk to break the disk and to lose important informations.
nano /usr/local/etc/doas.conf
permit :wheel
permit nopass keepenv marietto
# cp /usr/local/bin/qemu-system-x86_64 /usr/local/bin/qemu-
system-x86_64-debian_fsnano /usr/local/etc/doas.conf
permit :wheel
permit nopass keepenv marietto
# cp /usr/local/bin/qemu-system-x86_64 /usr/local/bin/qemu-
system-x86_64-debian_fs
and this is the little script that I wrote that does the job :
#!/usr/local/bin/bash
vmdisk1=`geom disk list | awk '/^Geom name: /{d=$NF} /^
*ident: (NM13N4CZ)/ && d{print d}'`
echo "Seagate M3 Portable 1.8 TB UFS ; $vmdisk1"
vmdisk2=`geom disk list | awk '/^Geom name: /{d=$NF} /^
*ident: (2015020204055E)/ && d{print d}'`
echo "TOSHIBA External USB 3.0 1.8 TB ZFS ; $vmdisk2"
vmdisk3=`geom disk list | awk '/^Geom name: /{d=$NF} /^
*ident: (20130506005976F)/ && d{print d}'`
echo "TOSHIBA External USB 3.0 932G ZFS ; $vmdisk3"
vmdisk4=`geom disk list | awk '/^Geom name: /{d=$NF} /^
*ident: (BE0191500218)/ && d{print d}'`
echo "G-DRIVE USB UFS ; $vmdisk4"
vmdisk5=`geom disk list | awk '/^Geom name: /{d=$NF} /^
*ident: (38434B4237354B45)/ && d{print d}'`
echo "Elements NTFS ; $vmdisk5"
PS3='Please enter your choice. Options :
1. From TOSHIBA External USB 3.0 1.8 TB ZFS to Elements NTFS
and viceversa
2. From TOSHIBA External USB 3.0 932G ZFS to Elements NTFS
and viceversa
3. From G-DRIVE USB UFS to Elements NTFS and viceversa
4. From Seagate M3 Portable 1.8 TB UFS to Elements NTFS and
viceversa
5. ssh debian_fs / Copy Files
6. Check qemu vms
7. Kill debian_fs
8. Quit
Your choice is : '
options=("1. From TOSHIBA External USB 3.0 1.8 TB ZFS to
Elements NTFS and viceversa" "2. From TOSHIBA External USB
3.0 932G ZFS to Elements NTFS and viceversa" "3. From G-DRIVE
USB UFS to Elements NTFS and viceversa" "4. From Seagate M3
Portable 1.8 TB UFS to Elements NTFS and viceversa" "5. ssh
debian_fs / Copy Files" "6. Check qemu vms" "7. Kill
debian_fs" "8. Quit")
select opt in "${options[@]}"
do
case $opt in
"1. From TOSHIBA External USB 3.0 1.8 TB ZFS to
Elements NTFS and viceversa")
doas zpool export -f zroot-133 && umount /dev/
$vmdisk5'p1'
doas qemu-system-x86_64-debian_fs
-machine q35
-cpu kvm64,hv_relaxed,hv_time,hv_synic -m 1G
-vga std -drive file=Debian-fs.img,format=raw
-drive file=dev/$vmdisk2,format=raw
-drive file=/dev/$vmdisk5,format=raw -rtc base=localtime
-device usb-ehci,id=usb,bus=pcie.0,addr=0x3
-device usb-tablet -device usb-kbd -smbios type=2
-nodefaults
-netdev tap,id=mynet0,ifname=tap19,script=no,downscript=no
-device e1000,netdev=mynet0,mac=52:55:00:d1:55:01
-device ich9-ahci,id=sata
-drive if=pflash,format=raw,readonly=on,file=/
usr/local/share/edk2-qemu/QEMU_UEFI_CODE-x86_64.fd
-drive if=pflash,format=raw,file=/usr/local/share/edk2-qemu/
QEMU_UEFI_VARS-x86_64.fd
-nographic -serial none -monitor none &
;;
"2. From TOSHIBA External USB 3.0 932G ZFS to
Elements NTFS and viceversa")
doas zpool export -f zroot2 && umount /dev/
$vmdisk5'p1'
doas qemu-system-x86_64-debian_fs
-machine q35 -cpu kvm64,hv_relaxed,hv_time,hv_synic -m 1G
-vga std -drive file=Debian-fs.img,format=raw
-drive file=/dev/$vmdisk3,format=raw
-drive file=/dev/$vmdisk5,format=raw
-rtc base=localtime
-device usb-ehci,id=usb,bus=pcie.0,addr=0x3
-device usb-tablet -device usb-kbd -smbios type=2
-nodefaults
-netdev tap,id=mynet0,ifname=tap19,script=no,downscript=no
-device e1000,netdev=mynet0,mac=52:55:00:d1:55:01
-device ich9-ahci,id=sata
-drive if=pflash,format=raw,readonly=on,file=/usr/local/share/edk2-qemu/QEMU_UEFI_CODE-x86_64.fd
-drive if=pflash,format=raw,file=/usr/local/share/edk2-qemu/
QEMU_UEFI_VARS-x86_64.fd
-nographic -serial none -monitor none &
;;
"3. From G-DRIVE USB UFS to Elements NTFS and
viceversa")
doas umount /dev/$vmdisk4'p2' && umount /dev/
$vmdisk5'p1'
doas qemu-system-x86_64-debian_fs
-machine q35 -cpu kvm64,hv_relaxed,hv_time,hv_synic -m 1G
-vga std -drive file=Debian-fs.img,format=raw
-drive file=dev/$vmdisk4,format=raw
-drive file=/dev/$vmdisk5,format=raw -rtc base=localtime
-device usb-ehci,id=usb,bus=pcie.0,addr=0x3
-device usb-tablet -device usb-kbd -smbios type=2
-nodefaults
-netdev tap,id=mynet0,ifname=tap19,script=no,downscript=no
-device e1000,netdev=mynet0,mac=52:55:00:d1:55:01
-device ich9-ahci,id=sata
-drive if=pflash,format=raw,readonly=on,file=/
usr/local/share/edk2-qemu/QEMU_UEFI_CODE-x86_64.fd
-drive if=pflash,format=raw,file=/usr/local/share/edk2-qemu/
QEMU_UEFI_VARS-x86_64.fd
-nographic -serial none -monitor none &
;;
"4. From Seagate M3 Portable 1.8 TB UFS to Elements
NTFS and viceversa")
doas umount /dev/$vmdisk1'p2' && umount /dev/
$vmdisk5'p1'
doas qemu-system-x86_64-debian_fs
-machine q35 -cpu kvm64,hv_relaxed,hv_time,hv_synic -m 1G
-vga std -drive file=Debian-fs.img,format=raw
-drive file=dev/$vmdisk1,format=raw
-drive file=/dev/$vmdisk5,format=raw -rtc base=localtime
-device usb-ehci,id=usb,bus=pcie.0,addr=0x3
-device usb-tablet -device usb-kbd -smbios type=2
-nodefaults
-netdev tap,id=mynet0,ifname=tap19,script=no,downscript=no
-device e1000,netdev=mynet0,mac=52:55:00:d1:55:01
-device ich9-ahci,id=sata
-drive if=pflash,format=raw,readonly=on,file=/
usr/local/share/edk2-qemu/QEMU_UEFI_CODE-x86_64.fd
-drive if=pflash,format=raw,file=/usr/local/share/edk2-qemu/
QEMU_UEFI_VARS-x86_64.fd
-nographic -serial none -monitor none &
;;
"5. ssh debian_fs / Copy Files")
ssh -Y [email protected]
;;
"6. Check qemu vms")
ps ax | grep qemu
;;
"7. Kill debian_fs")
pgrep qemu-system-x86_64-debian_fs | xargs kill
;;
"8. Quit")
break
;;
*) echo "invalid option $REPLY";;
esac
done#!/usr/local/bin/bash
vmdisk1=`geom disk list | awk '/^Geom name: /{d=$NF} /^
*ident: (NM13N4CZ)/ && d{print d}'`
echo "Seagate M3 Portable 1.8 TB UFS ; $vmdisk1"
vmdisk2=`geom disk list | awk '/^Geom name: /{d=$NF} /^
*ident: (2015020204055E)/ && d{print d}'`
echo "TOSHIBA External USB 3.0 1.8 TB ZFS ; $vmdisk2"
vmdisk3=`geom disk list | awk '/^Geom name: /{d=$NF} /^
*ident: (20130506005976F)/ && d{print d}'`
echo "TOSHIBA External USB 3.0 932G ZFS ; $vmdisk3"
vmdisk4=`geom disk list | awk '/^Geom name: /{d=$NF} /^
*ident: (BE0191500218)/ && d{print d}'`
echo "G-DRIVE USB UFS ; $vmdisk4"
vmdisk5=`geom disk list | awk '/^Geom name: /{d=$NF} /^
*ident: (38434B4237354B45)/ && d{print d}'`
echo "Elements NTFS ; $vmdisk5"
PS3='Please enter your choice. Options :
1. From TOSHIBA External USB 3.0 1.8 TB ZFS to Elements NTFS
and viceversa
2. From TOSHIBA External USB 3.0 932G ZFS to Elements NTFS
and viceversa
3. From G-DRIVE USB UFS to Elements NTFS and viceversa
4. From Seagate M3 Portable 1.8 TB UFS to Elements NTFS and
viceversa
5. ssh debian_fs / Copy Files
6. Check qemu vms
7. Kill debian_fs
8. Quit
Your choice is : '
options=("1. From TOSHIBA External USB 3.0 1.8 TB ZFS to
Elements NTFS and viceversa" "2. From TOSHIBA External USB
3.0 932G ZFS to Elements NTFS and viceversa" "3. From G-DRIVE
USB UFS to Elements NTFS and viceversa" "4. From Seagate M3
Portable 1.8 TB UFS to Elements NTFS and viceversa" "5. ssh
debian_fs / Copy Files" "6. Check qemu vms" "7. Kill
debian_fs" "8. Quit")
select opt in "${options[@]}"
do
case $opt in
"1. From TOSHIBA External USB 3.0 1.8 TB ZFS to
Elements NTFS and viceversa")
doas zpool export -f zroot-133 && umount /dev/
$vmdisk5'p1'
doas qemu-system-x86_64-debian_fs
-machine q35 -cpu kvm64,hv_relaxed,hv_time,hv_synic -m 1G
-vga std -drive file=Debian-fs.img,format=raw
-drive file=/dev/$vmdisk2,format=raw
-drive file=/dev/$vmdisk5,format=raw -rtc base=localtime
-device usb-ehci,id=usb,bus=pcie.0,addr=0x3
-device usb-tablet -device usb-kbd -smbios type=2
-nodefaults
-netdev tap,id=mynet0,ifname=tap19,script=no,downscript=no
-device e1000,netdev=mynet0,mac=52:55:00:d1:55:01
-device ich9-ahci,id=sata
-drive if=pflash,format=raw,readonly=on,file=/
usr/local/share/edk2-qemu/QEMU_UEFI_CODE-x86_64.fd
-drive if=pflash,format=raw,file=/usr/local/share/edk2-qemu/
QEMU_UEFI_VARS-x86_64.fd
-nographic -serial none -monitor none &
;;
"2. From TOSHIBA External USB 3.0 932G ZFS to
Elements NTFS and viceversa")
doas zpool export -f zroot2 && umount /dev/
$vmdisk5'p1'
doas qemu-system-x86_64-debian_fs
-machine q35 -cpu kvm64,hv_relaxed,hv_time,hv_synic -m 1G
-vga std -drive file=Debian-fs.img,format=raw
-drive file=/dev/$vmdisk3,format=raw
-drive file=/dev/$vmdisk5,format=raw
-rtc base=localtime
-device usb-ehci,id=usb,bus=pcie.0,addr=0x3
-device usb-tablet -device usb-kbd -smbios type=2
-nodefaults
-netdev tap,id=mynet0,ifname=tap19,script=no,downscript=no
-device e1000,netdev=mynet0,mac=52:55:00:d1:55:01
-device ich9-ahci,id=sata
-drive if=pflash,format=raw,readonly=on,file=/usr/local/share/edk2-qemu/QEMU_UEFI_CODE-x86_64.fd
-drive if=pflash,format=raw,file=/usr/local/share/edk2-qemu/
QEMU_UEFI_VARS-x86_64.fd
-nographic -serial none -monitor none &
;;
"3. From G-DRIVE USB UFS to Elements NTFS and
viceversa")
doas umount /dev/$vmdisk4'p2' && umount /dev/
$vmdisk5'p1'
doas qemu-system-x86_64-debian_fs
-machine q35 -cpu kvm64,hv_relaxed,hv_time,hv_synic -m 1G
-vga std -drive file=Debian-fs.img,format=raw
-drive file=/dev/$vmdisk4,format=raw
-drive file=/dev/$vmdisk5,format=raw -rtc base=localtime
-device usb-ehci,id=usb,bus=pcie.0,addr=0x3
-device usb-tablet -device usb-kbd -smbios type=2
-nodefaults
-netdev tap,id=mynet0,ifname=tap19,script=no,downscript=no
-device e1000,netdev=mynet0,mac=52:55:00:d1:55:01
-device ich9-ahci,id=sata
-drive if=pflash,format=raw,readonly=on,file=/
usr/local/share/edk2-qemu/QEMU_UEFI_CODE-x86_64.fd
-drive if=pflash,format=raw,file=/usr/local/share/edk2-qemu/
QEMU_UEFI_VARS-x86_64.fd
-nographic -serial none -monitor none &
;;
"4. From Seagate M3 Portable 1.8 TB UFS to Elements
NTFS and viceversa")
doas umount /dev/$vmdisk1'p2' && umount /dev/
$vmdisk5'p1'
doas qemu-system-x86_64-debian_fs
-machine q35 -cpu kvm64,hv_relaxed,hv_time,hv_synic -m 1G
-vga std -drive file=Debian-fs.img,format=raw
-drive file=/dev/$vmdisk1,format=raw
-drive file=/dev/$vmdisk5,format=raw -rtc base=localtime
-device usb-ehci,id=usb,bus=pcie.0,addr=0x3
-device usb-tablet -device usb-kbd -smbios type=2
-nodefaults
-netdev tap,id=mynet0,ifname=tap19,script=no,downscript=no
-device e1000,netdev=mynet0,mac=52:55:00:d1:55:01
-device ich9-ahci,id=sata
-drive if=pflash,format=raw,readonly=on,file=/
usr/local/share/edk2-qemu/QEMU_UEFI_CODE-x86_64.fd
-drive if=pflash,format=raw,file=/usr/local/share/edk2-qemu/
QEMU_UEFI_VARS-x86_64.fd
-nographic -serial none -monitor none &
;;
"5. ssh debian_fs / Copy Files")
ssh -Y [email protected]
;;
"6. Check qemu vms")
ps ax | grep qemu
;;
"7. Kill debian_fs")
pgrep qemu-system-x86_64-debian_fs | xargs kill
;;
"8. Quit")
break
;;
*) echo "invalid option $REPLY";;
esac
done
I find also comfortable to import or not to import my ZFS disks at certain conditions putting this script in /home/marietto/.zshrc ; this step is important to avoid mounting conflicts with the previous script...
# nano /home/marietto/.zshrc
if [ ! -d /mnt/zroot2/zroot2/zroot2-pool ] && ! pgrep -f qemu-system-x86_64-debian_fs &> /dev/null 2>&1; then
echo "zpool/zroot2 hasn't been imported. Importing..."
doas zpool import -f -R /mnt/zroot2 zroot2
else
echo "zpool/zroot2 has been already imported"
fi
if [ ! -d /mnt/zroot-133/_13.3_CURRENT_ ] && ! pgrep -f qemu-system-x86_64-debian_fs &> /dev/null 2>&1; then
echo "zpool/zroot-133 hasn't been imported. Importing..."
doas zpool import -f -R /mnt/zroot-133 zroot-133
else
echo "zpool/zroot-133 has been already imported"
fi#
# nano /home/marietto/.zshrc
if [ ! -d /mnt/zroot2/zroot2/zroot2-pool ] && ! pgrep -f qemu-system-x86_64-debian_fs &> /dev/null 2>&1; then
echo "zpool/zroot2 hasn't been imported. Importing..."
doas zpool import -f -R /mnt/zroot2 zroot2
else
echo "zpool/zroot2 has been already imported"
fi
if [ ! -d /mnt/zroot-133/_13.3_CURRENT_ ] && ! pgrep -f qemu-system-x86_64-debian_fs &> /dev/null 2>&1; then
echo "zpool/zroot-133 hasn't been imported. Importing..."
doas zpool import -f -R /mnt/zroot-133 zroot-133
else
echo "zpool/zroot-133 has been already imported"
fi
anyway I'm not satisfied. I would like to have a better integration of the script with the system,without having to run the script everytime I need to copy my files to a NTFS or EXT* disk.
r/freebsd • u/Fergus653 • 2d ago
discussion Copilot - your friendly helpful FreeBSD assistant
Well, almost, anyway...
I decided to have some BSD fun on an old laptop, got FreeBSD up and running then for fun I asked Edge Copilot how to set up the wifi. It confidently gives simple instructions with great explanations, and mostly they work. Still needed to look some stuff up on the web tho, as I think it sourced some of it's info from quite old web pages.
Who has tried Copilot for installation or config advice for FreeBSD and how good did you find it's responses?
r/freebsd • u/jd823592 • 3d ago
Hardware Virtualization, Passthroughs, ...
How far from reality is it, using the standard FreeBSD tools, to install a very lightweight freebsd base system, use bhyve or something like that to run different oses (other instances of fbsd, linux, even windows) with the ability to share and redistribute storage space between the virtualized systems, share network connectivity, dedicate (and if I could get crazy, even switch) gpu to a selected system. I am thinking a dualboot on steroids, where I'd primarily use one OS but could have other tasks running in the other OSes; tunneling network from one through another that would for example provide vpn or something; having one firewall in the base system rather than rely on individual setups of individual end systems. What would be the expected performance? Can anything like this be made possible without a huge performance penalty?
I do realize gpu (pci) passthrough is probably one of the more experimental parts of this question but how distant is a hypothetical working solution? Does the rest even make sense. Am I missing something. Is there a good comprehensive reading material? I've been trying to educate myself on system stuff for years but I lack the time to try to piece the whole picture together and always find myself forgetting most of what I once learned. A well structured resource could help me, so if anyone is aware, please let me know. Thanks!
r/freebsd • u/grahamperrin • 3d ago
discussion Networking: wired and Wi-Fi in multiple locations
Using FreeBSD 15.0-CURRENT with:
Sometimes different subnets at home. Different subnets at work.
All DHCP.
The gif0
tunnel is rarely used. Used solely with em0
, solely at home. I usually take it down after starting the OS:
ifconfig gif0 down
When wired networking is preferred
Typically, preferred for performance.
With gif0
already down, I run the following command (verbose):
ls /var/run/resolvconf/interfaces/ ; route delete default ; ifconfig wlan0 down && ifconfig em0 down && sleep 5 ; ls /var/run/resolvconf/interfaces/ ; ifconfig em0 up && sleep 15 ; ls /var/run/resolvconf/interfaces/ ; cat /etc/resolv.conf ; ping -c 2 -4 freshports.org
– or non-verbose:
route delete default ; ifconfig wlan0 down && ifconfig em0 down && sleep 5 ; ifconfig em0 up && sleep 15
When Wi-Fi is preferred
Given the successes above, I imagine that the command below should have a successful end result:
route delete default ; ifconfig wlan0 down && ifconfig em0 down && sleep 5 ; ifconfig wlan0 up && sleep 15
The actual result, today at home:
/etc/resolv.conf
has no nameserver.
Relevant lines from /etc/rc.conf
Using ⋯
to obscure addresses:
ipv6_activate_all_interfaces="NO"
ipv6_defaultrouter="⋯"
ifconfig_em0="DHCP"
wlans_iwm0="wlan0"
create_args_wlan0="country GB regdomain etsi"
ifconfig_wlan0="WPA DHCP"
cloned_interfaces="gif0"
create_args_gif0="tunnel 192.168.1.10 ⋯ mtu 1480"
ifconfig_gif0_ipv6="inet6 ⋯ ⋯ prefixlen 128 NOAUTO"
help needed Does clonezilla support cloning FreeBSD drives?
Hi,
I'm trying to save a FreeBSD disk using Clonezilla but I'm seeing the utility save the raw partitions and then the UFS partitions. Is this normal? I would think it should be sufficient if Clonezilla just save the raw partitions which will include the UFS slices.
The clonezilla subreddit is private so I can't post there. I'm wondering if there is an option to only clone the partitions seen by fdisk and not the slices.
EDIT: Trying to image parts instead of disks then manually select all non-UFS partitions.
r/freebsd • u/grahamperrin • 4d ago
article Improving and debugging FreeBSD’s Intel Wi-Fi support: Cheng Cui’s key role in the iwlwifi project | FreeBSD Foundation
freebsdfoundation.orgr/freebsd • u/PhaserGames • 4d ago
discussion Many thanks to the dotnet-8.0.0 port maintainer!!!
I would just like to say many thanks to the dotnet-8.0.0 port maintainer on FreeBSD ports.
I decided to learn C# and the existence of this port just made my life insanely easier, and it will be even better when I release my application (a housekeeping CLI tool to clean browser cache files, etc, without breaking the OS).
Thank you, dear strange, to keep working hard to maintain this package!!!
r/freebsd • u/loziomario • 4d ago
article How to be protected by CloudFlare using FreeBSD...
Hello.
we can't install cloudflare warp 1111 directly in FreeBSD,but we can install it in a little Linux vm and we can forward the connection....
How to configure the qemu-Debian vm :
# apt install net-tools
# nano /etc/systemd/system/getty.target.wants/
[email protected]
ExecStart=-/sbin/agetty -o '-p -f -- u' --noclear --
autologin marietto %I $TERM
# apt-get install python3-tk curl gpg sudo mousepad
# Add cloudflare gpg key :
# curl -fsSL | sudo gpg --yes --dearmor --output /usr/share/
keyrings/cloudflare-warp-archive-keyring.gpg
# Add this repo to your apt repositories :
# echo "deb [signed-by=/usr/share/keyrings/cloudflare-warp-
archive-keyring.gpg] $(lsb_release -cs) main" | sudo tee /
etc/apt/sources.list.d/cloudflare-client.list
# Install :
# sudo apt-get update && sudo apt-get install cloudflare-warp
# nano /etc/apt/sources.list.d/cloudflare-client.list
deb [arch=amd64 signed-by=/usr/share/keyrings/cloudflare-
warp-archive-keyring.gpg] bookworm main
# warp-cli register
# cp /usr/sbin/iptables /usr/bin
# cp /usr/sbin/dhclient /usr/bin
# systemctl set-default
# nano /home/marietto/.profile
/usr/bin/warp
# nano /usr/bin/warp
function jumpto
{
label=$1
cmd=$(sed -n "/$label:/{:a;n;p;ba};" $0 | grep -v ':
$')
eval "$cmd"
exit
}
start=${1:-"start"}
jumpto $start
start:
sleep 2
warp-cli disconnect
sleep 2
OLD_IP="$(curl -s api.ipify.org)"
#echo 1 > /proc/sys/net/ipv4/ip_forward # I've uncommented
this parameter inside the file /etc/sysctl.conf)
sudo iptables -A POSTROUTING -t nat -s -j MASQUERADE
warp-cli connect
sleep 2
NEW_IP="$(curl -s api.ipify.org)"
echo Connected to Cloudflare Warp...
echo OLD IP is $OLD_IP , NEW IP is $NEW_IP
mid :
sleep 2
if [ "$OLD_IP = $NEW_IP ]
then
echo OLD IP is $OLD_IP , NEW IP is $NEW_IP : it does not work
anymore,reconnecting...
sleep 10
jump foo
else
echo OLD IP is $OLD_IP , NEW IP is $NEW_IP : it still works.
sleep 10
fi
sleep 2
jumpto mid
foo:
warp-cli disconnect
sleep 2
OLD_IP="$(curl -s api.ipify.org)"
warp-cli connect
sleep 2
NEW_IP="$(curl -s api.ipify.org)"
echo OLD IP is $OLD_IP , NEW IP is $NEW_IP : it works again.
sleep 2
jumpto mid
# chmod +x /usr/bin/warp
# nano /etc/sysctl.conf
net.ipv4.ip_forward=1
# nano /etc/sudoers
marietto ALL=(ALL) NOPASSWD: /usr/bin/iptables
marietto ALL=(ALL) NOPASSWD: /usr/bin/dhclient
marietto ALL=(ALL) NOPASSWD: /usr/bin/ifconfig
On FreeBSD :
nano /boot/loader.conf
if_tap_load="YES"
if_bridge_load="YES"
bridgestp_load="YES"
nano /etc/sysctl.conf :
net.link.tap.up_on_open=1
net.link.tap.user_open=1
net.inet.ip.forwarding=1
net.inet.ip.random_id=1
nano /etc/rc.conf :
cloned_interfaces="bridge0 tap0 tap1 tap2 tap3 tap4 tap5 tap6
tap7 tap8 tap9 tap10 tap11 tap12 tap13 tap14 tap15 tap16
tap17 tap18 tap19 tap20 em0 lo1"
ifconfig_bridge0="addm em0 addm tap0 addm tap1 addm tap2 addm
tap3 addm tap4 addm tap5 addm tap6 addm tap7 addm tap8 addm
tap9 addm tap10 addm tap11 addm tap12 addm tap13 addm tap14
addm tap15 addm tap16 addm tap17 addm tap18 addm tap19 addm
tap20"
ifconfig_em0="inet 192.168.1.5 netmask 255.255.255.0"
defaultrouter="192.168.1.2"
This script should be located inside the file /home/marietto/.zshrc (because I'm using zsh)
if ! pgrep -f qemu &> /dev/null 2>&1; then
echo "The qemu / Debian-warp vm is not running,starting..."
/usr/local/bin/qemu-system-x86_64 -machine q35
-cpu kvm64,hv_relaxed,hv_time,hv_synic -m 1G -vga std
-drive file=Debian-warp.img,format=raw -rtc base=localtime
-device usb-ehci,id=usb,bus=pcie.0,addr=0x3
-device usb-tablet -device usb-kbd -smbios type=2
-nodefaults
-netdev tap,id=mynet0,ifname=tap20,script=no,downscript=no
-device e1000,netdev=mynet0,mac=52:55:00:d1:55:01
-device ich9-ahci,id=sata
-drive if=pflash,format=raw,readonly=on,file=/usr/local/
share/edk2-qemu/QEMU_UEFI_CODE-x86_64.fd
-drive if=pflash,format=raw,file=/usr/local/share/edk2-qemu/
QEMU_UEFI_VARS-x86_64.fd -nographic -serial none -monitor none &
else
echo "The qemu / Debian-warp vm is already running."
fi
Et voila' : my Ip is protected by CloudFlare when I use FreeBSD.
r/freebsd • u/GreyhoundsAreFast • 5d ago
article ESET Research: Ebury botnet alive & growing; 400k Linux servers compromised for cryptocurrency theft and financial gain
eset.comr/freebsd • u/GrilledGuru • 5d ago
FreeBSD with libreboot
Hello How do you boot freebsd from libreboot ? Seabios works but it is unsecure I'd love to do with via grub
r/freebsd • u/al2klimov • 5d ago
FreeBSD or Linux for softRAID1+crypto on old tower?
Hello everyone! My storage server, powered by OpenBSD, hanged up itself once more. I.e. HDD I/O indicator LED constantly on, as if it writes something, but no reaction to ANY kind of input and no output at all. My hypothesis is that a disk broke, did something unexpected or was just overloaded. Or something with a SATA port, whatever. And this is OK, I mean who has no bad days? But then I‘d like my new OS to fail gracefully. EIO errno, syslog, … at its option. Which one should I pick? Which one is the chicken I could cut the head off, but it will continue running around? Best, A/K
r/freebsd • u/AntranigV • 7d ago
FAQ Frequent reminder that FreeBSD is an open-source project && myth busting
I don't always use Reddit, but when I do, I spend 2 days answering as much questions as I can.
During the last two days, I've seen multiple statements such as "I love the handbook, but the wiki needs to get better, similar to the Arch Wiki" or "I can find program X in ports, but it's not in packages" and more.
This is a frequent reminder that FreeBSD is an open-source project, which distributes documentation, ports, packages and a complete operating system.
If you think the Wiki is missing something, add to it. It doesn't have to be good, it just has to exist. We can clean it up later. Something is better than nothing.
If you think a package is missing while the port exists, open an issue.
If you don't have the skills to do that, but you care about the package/docs, ask here! we'll be happy to assist.
Finally, there are a lot of myths around FreeBSD.
The most common one that keeps killing me inside is "it doesn't have as many packages as Debian/Ubuntu/YourFavoriteLinuxDistroHere", however, keep in mind that Linux distros make separate packages for docs and dev, while in FreeBSD it's combined. Currently I'm working on a script that does actual comparison using the content, not just package count. From what I can see, we're pretty much on par, and in some specific scenarios (specially the Python packages) we're even in the lead, due to our porting process.
Another common myth is that people can't do DevOps using FreeBSD. This one hurts even more because I've migrated many legacy companies to be more DevOps-oriented using FreeBSD. I think people confuse "tools" and "processes". Using Docker is a tool, the process is "shipping OS images". On FreeBSD, you can ship an image by doing make release
. The tool is "Jenkins", the process is "packaging complex java software", you can do that on FreeBSD using Poudriere. I guess people are okay with learning 5723945723489532 JS frameworks that born and die ever month or so, but are not okay with learning FreeBSD tools that have been around for 15+ years. At some point I'm thinking that the only solution to this is to write blog posts, um sorry I mean YouTube videos (How do you do, fellow kids?) about tools that bring FreeBSD into the DevOps pipelines (and show how simpler things are on FreeBSD).
Cheers y'all
(edit: typos)
r/freebsd • u/loziomario • 6d ago
How to put a qemu vm in background,early in the bootloader and hidden between the FreeBSD processes.
Hello.
I would like to put the qemu / debian vm that I've created in the background early in the FreeBSD bootloader process and forget it,but I'm having some troubles. The Debian 12 vm that I need should only run a little script. It doesn't even need to run xorg and one desktop environment. This is the script that it should run as soon as the user "marietto" reached the prompt and it has automatically authenticated :
function jumpto
{
label=$1
cmd=$(sed -n "/$label:/{:a;n;p;ba};" $0 | grep -v ':$')
eval "$cmd"
exit
}
start=${1:-"start"}
jumpto $start
start:
warp-cli disconnect
OLD_IP="$(curl -s
api.ipify.org
)"
sudo iptables -A POSTROUTING -t nat -s
192.168.1.5
-j
MASQUERADE
warp-cli connect
NEW_IP="$(curl -s
api.ipify.org
)"
echo Connected to Cloudflare Warp...echo OLD IP is $OLD_IP ,
NEW IP is $NEW_IP
mid :
if [ "$OLD_IP = $NEW_IP ]
then
echo OLD IP is $OLD_IP , NEW IP is $NEW_IP : it does not work
anymore,reconnecting...
sleep 10
jump foo
else
echo OLD IP is $OLD_IP , NEW IP is $NEW_IP : it still works.
sleep 10
fi
jumpto mid
foo:
warp-cli disconnect
OLD_IP="$(curl -s
api.ipify.org
)"
warp-cli connect
NEW_IP="$(curl -s
api.ipify.org
)"echo OLD IP is $OLD_IP ,
NEW IP is $NEW_IP : it works again.
jumpto mid
I tried in several ways to put the vm in background or better...to hide it between the processes,but every method used failed. So,please,advice.
This is what I tried :
nohup /usr/local/bin/qemu-system-x86_64 -machine q35
-cpu kvm64,hv_relaxed,hv_time,hv_synic -m 1G
-vga std -drive file=Debian-warp.img,format=raw
-rtc base=localtime
-device usb-ehci,id=usb,bus=pcie.0,addr=0x3
-device usb-tablet -device usb-kbd -smbios type=2
-nodefaults
-netdev tap,id=mynet0,ifname=tap20,script=no,downscript=no
-device e1000,netdev=mynet0,mac=52:55:00:d1:55:01
-device ich9-ahci,id=sata
-drive if=pflash,format=raw,readonly=on,file=/usr/local/share/
edk2-qemu/QEMU_UEFI_CODE-x86_64.fd
-drive if=pflash,format=raw,file=/usr/local/share/edk2-qemu/
QEMU_UEFI_VARS-x86_64.fd</dev/null >/dev/null 2>&1 &
if test -f nohup.out; then rm -r nohup.out
fi
2)
/usr/local/bin/qemu-system-x86_64 -machine q35
-cpu kvm64,hv_relaxed,hv_time,hv_synic -m 1G -nographic
-drive file=Debian-warp.img,format=raw
-rtc base=localtime
-device usb-ehci,id=usb,bus=pcie.0,addr=0x3
-device usb-tablet -device usb-kbd -smbios type=2
-nodefaults
-netdev tap,id=mynet0,ifname=tap20,script=no,downscript=no
-device e1000,netdev=mynet0,mac=52:55:00:d1:55:01
-device ich9-ahci,id=sata
-drive if=pflash,format=raw,readonly=on,file=/usr/local/share/
edk2-qemu/QEMU_UEFI_CODE-x86_64.fd
-drive if=pflash,format=raw,file=/usr/local/share/edk2-qemu/
QEMU_UEFI_VARS-x86_64.fd
3)
/usr/local/bin/qemu-system-x86_64 -machine q35
-cpu kvm64,hv_relaxed,hv_time,hv_synic -m 1G
-display curses
-drive file=Debian-warp.img,format=raw
-rtc base=localtime
-device usb-ehci,id=usb,bus=pcie.0,addr=0x3
-device usb-tablet -device usb-kbd -smbios type=2
-nodefaults
-netdev tap,id=mynet0,ifname=tap20,script=no,downscript=no
-device e1000,netdev=mynet0,mac=52:55:00:d1:55:01
-device ich9-ahci,id=sata
-drive if=pflash,format=raw,readonly=on,file=/usr/local/share/
edk2-qemu/QEMU_UEFI_CODE-x86_64.fd
-drive if=pflash,format=raw,file=/usr/local/share/edk2-qemu/
QEMU_UEFI_VARS-x86_64.fd
4)
nohup /usr/local/bin/qemu-system-x86_64 -machine q35
-cpu kvm64,hv_relaxed,hv_time,hv_synic -m 1G -nographic
-drive file=Debian-warp.img,format=raw
-rtc base=localtime
-device usb-ehci,id=usb,bus=pcie.0,addr=0x3
-device usb-tablet -device usb-kbd -smbios type=2
-nodefaults
-netdev tap,id=mynet0,ifname=tap20,script=no,downscript=no
-device e1000,netdev=mynet0,mac=52:55:00:d1:55:01
-device ich9-ahci,id=sata
-drive if=pflash,format=raw,readonly=on,file=/usr/local/share/
edk2-qemu/QEMU_UEFI_CODE-x86_64.fd
-drive if=pflash,format=raw,file=/usr/local/share/edk2-qemu/
QEMU_UEFI_VARS-x86_64.fd</dev/null >/dev/null 2>&1 &
if test -f nohup.out; then rm -r nohup.out
fi
5)
nohup /usr/local/bin/qemu-system-x86_64 -machine q35
-cpu kvm64,hv_relaxed,hv_time,hv_synic -m 1G
-display curses
-drive file=Debian-warp.img,format=raw
-rtc base=localtime
-device usb-ehci,id=usb,bus=pcie.0,addr=0x3
-device usb-tablet -device usb-kbd -smbios type=2
-nodefaults
-netdev tap,id=mynet0,ifname=tap20,script=no,downscript=no
-device e1000,netdev=mynet0,mac=52:55:00:d1:55:01
-device ich9-ahci,id=sata
-drive if=pflash,format=raw,readonly=on,file=/usr/local/share/
edk2-qemu/QEMU_UEFI_CODE-x86_64.fd
-drive if=pflash,format=raw,file=/usr/local/share/edk2-qemu/
QEMU_UEFI_VARS-x86_64.fd</dev/null >/dev/null 2>&1 &
if test -f nohup.out; then rm -r nohup.out
fi
The final result is always the same : when I ping the IP address assigned to the vm,it doesn't. But it works when I boot the vm in this way :
/usr/local/bin/qemu-system-x86_64 -machine q35
-cpu kvm64,hv_relaxed,hv_time,hv_synic -m 1G -vga std
-drive file=Debian-warp.img,format=raw -rtc base=localtime
-device usb-ehci,id=usb,bus=pcie.0,addr=0x3
-device usb-tablet -device usb-kbd -smbios type=2
-nodefaults
-netdev tap,id=mynet0,ifname=tap20,script=no,downscript=no
-device e1000,netdev=mynet0,mac=52:55:00:d1:55:01
-device ich9-ahci,id=sata
-drive if=pflash,format=raw,readonly=on,file=/usr/local/share/
edk2-qemu/QEMU_UEFI_CODE-x86_64.fd
-drive if=pflash,format=raw,file=/usr/local/share/edk2-qemu/
QEMU_UEFI_VARS-x86_64.fd
Do you know what's the correct syntax to achieve what I want ? thanks again.
r/freebsd • u/PalladiumNextOnline • 7d ago
discussion The BSDs are such a breath of fresh air.
I know I'm preaching to the choir here, but I've only started messing around with them in the last few months, so I need to say my piece.
I'm a .NET dev, I've been forced to use windows for my entire career, and have used linux on servers and personal laptops for almost a decade. Coming here, and seeing how complete, simple, and clean a fresh FreeBSD and NetBSD install is every time is so satisfying. I have complete confidence that everything just WORKS if the configs are right (and the hardware is supported).
I love just spinning up a fresh install, installing ONLY what I need, and then that box just being rock solid with a well maintained and closely vetted supply chain.
I don't believe people like jumping on the new FOTM linux distro, learning what key pieces of architecture have changed in the last 3 years, and hoping everything in their tool chain still works.
I just don't believe they have exposure to this. Why there isn't more institutional/government/corporate buy in, I'll never understand. The GPL, I feel, stifles innovation and is a corporate liability. The supply chain for most distros almost rises to the level of a national security risk, as evidenced by the XZ backdoor. The whole Linux ecosystem is beginning to feel like complete chaos.
How do we get more people to see the light?
r/freebsd • u/TETH_IO • 6d ago
pkg offline bootstrapping ?
Hi, I've just installed FreeBSD but I'm missing the network driver.
I've fetched the relevent pkg from a vm but I first need de bootstrap pkg.
Anyone knows what to import into the machine to offline boostrap pkg ? (I guess I need to fetch pkg.txz but I can't find it)
Thanks !
Upgrading Fedora Linux on bhyve
Hello together,
I am in the process of setting up a Linux VM preferably Fedora Linux with bhyve on my FreeBSD server.
It is all installing and running good until I want to upgrade from Fedora 39 to 40 using the standard Fedora guide. Then the VM just can't boot anymore when it finishes installing the updates. I tried again by setting up the VM fresh, but the problem was still present.
My .conf look like this:
guest="linux"
loader="uefi"
cpu=2
memory=4G
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0"
disk0_dev="sparse-zvol"
graphics="yes"
Did one of you also have this problem?
Greetings
EDIT: I still with all the info and some more troubleshooting get the error 'initramfs not found' and I don't get any UEFI interface.
This seems to be related to the latest version Fedora 40. When I upgrade from a Fedora 38 VM to Fedora 39 everything is fine.
Not nice. I will try out Debian in the meantime and check if it runs more smooth with grub which so far seems to be the case.
r/freebsd • u/linux_is_the_best001 • 8d ago
discussion What is that one application that you miss badly under FreeBSD?
My desktop went bad a month ago. As soon as I assemble a new one I will install either FreeBSD or OpenBSD. I wish I knew how to dual boot FreeBSD and OpenBSD.
Personally I miss the megsSYNC cloud backup app. I use Firefox only for all my web browsing so I don't miss Google Chrome at all.
What is that one application that you miss badly under FreeBSD?
r/freebsd • u/Knoxduder • 7d ago
help needed Help with Wifi on 2010 17" Macbook Pro / Broadcom BCM43224n Dual band
Greetings knowledgeable users!
I have this issue has been addressed with Broadcom cards in the this class/family in some other post and forums, in the not to far off past, however, the solutions seem to be beyond my scope of understanding or technical prowess.
I am new to FreeBSD, and I desire to learn it as much as possible.
I am stuck trying to get this wifi card working. It does not seem to be an abnormal problem; however, I could really use some more direct guidance and know how if anyone would be willing to help me. I desire to learn how to apply the solution as well as fixing the solution itself. I am willing to pay for the time if need be.
It would seem as though knowledgeable users have resolved this issue in the past, but I am unable to put together and execute the solution from cradle to grave. I thought I read something about recompiling a kernel or custom kernel.. I'm not afraid to get my hands dirty, I just need some guidance.
I'm willing to pay for the time and help if need be. I might have to just go back to Fedora or something similar on the MacBook Pro (it was working with the wifi out of the box) and stick to FreeBSD in a VM.
Have a great day!
r/freebsd • u/GrilledGuru • 8d ago
discussion Best Web browser for FreeBSD
Hello
Is there a decent (based on firefox or chromium) that is native to freebsd ?
By native I mean not using the linux emulation.
I would love to see one of those : - Thorium (chromium), - Mercury (firefox) - QuteBrowser (qtwebengine = chromium) - Vieb (electron = chromium)
Thanks
Edit: not directly firefox or chromium because of telemetry