/r/freebsd

Photograph via snooOG

Unofficial subreddit for The FreeBSD Project

Unofficial subreddit for the FreeBSD Project. Project goal:

… to provide a high-quality, open-source UNIX®-like operating system that excels in terms of performance, security, and stability.

Related:


Other areas of interest:


Formatting in Reddit:

– please note, indented code blocks are the only form that work on old Reddit; use indents for compatibility.

/r/freebsd

30,332 Subscribers

7

Best GUI app for bhyve management?

Just starting to learn bhyve. Before I get to learning the scripting I wanted the backstop of a GUI to confirm what I've done. Is there a consensus GUI / TUI app to use?

Thanks!

5 Comments
2024/04/08
13:00 UTC

4

Cannot Connect to Wifi after Installation

I'm new to FreeBSD, transitioning from a Linux desktop environment. After installing on a old laptop which I used to run Ubuntu, I cannot connect to Wifi.

I used the command pciconf -lv to identify my wireless network adapter, which appears to be an rtw880. The `ifconfig` only returned `lo` and not `wlan`. I'm struggling to figure out how to get the WiFi to work on FreeBSD. Despite searching, I haven't found clear instructions on how to proceed. Can you help me with this?

4 Comments
2024/04/08
11:00 UTC

35

Found in the wild

3 Comments
2024/04/08
02:47 UTC

13

Is the Wi-Fi any better in 15?

I’m going to need to either switch to 15 or OpenBSD or Gentoo.

I can’t take it anymore with Wi-Fi just not working. Yes, it’ll work but not all the time. Most of the time after waking it up I have to end up netif wlan0 stop, unload the kernel modules, reload them, then netif wlan0 start. On the very rare occasion, just restarting the interface can get it to work but more often than not I have to reload the modules.

So, how is the Wi-Fi on 15?

23 Comments
2024/04/07
19:58 UTC

2

Is FreeBSD 1.0 Decent?

I know that shit hella old but is it still possible to use it?

18 Comments
2024/04/07
15:52 UTC

5

More VM networking weirdness

EDIT: Reported https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278245


This is a bit of a followup to my previous post. The current configuration is basically the same, except I'm now on 14.0-RELEASE-p6, and ue0 has been removed.

Relevant ifconfig output:

root@donnager:~ # ifconfig em0
em0: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
        options=a520b9<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,WOL_MAGIC,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,HWSTATS>
        ether 6c:4b:90:1f:e9:a8
        inet 192.168.11.15 netmask 0xffffff00 broadcast 192.168.11.255
        inet6 fe80::6e4b:90ff:fe1f:e9a8%em0 prefixlen 64 scopeid 0x1
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
root@donnager:~ # ifconfig vm-public
vm-public: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
        options=0
        ether 3a:47:10:77:5b:4d
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
        member: tap3 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 7 priority 128 path cost 2000000
        member: tap2 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 6 priority 128 path cost 2000000
        member: tap1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 5 priority 128 path cost 2000000
        member: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 4 priority 128 path cost 2000000
        member: em0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 1 priority 128 path cost 20000
        groups: bridge vm-switch viid-4c918@
        nd6 options=9<PERFORMNUD,IFDISABLED>

vm-public is a bridge created by vm-bhyve. This configuration is after the issue has been resolved.

The problem I was having is that a large POST request doesn't make it through this flow:

Browser -> nginx reverse proxy (bare-metal) -> Docker container on bhyve VM

As far as I can tell, the request makes it from the browser to nginx, nginx connects to the VM and sends the request, but the VM never receives it. netstat reports an ESTABLISHED connection from the machine to the VM with a large Send-Q (~33,000 bytes), the target VM shows the connection but no Recv-Q.

After much playing around with things that were not the issue (e.g., nginx config), I remembered my previous post and started playing with flags on em0. By running ifconfig em0 -mextpg my large POST request went through perfectly.

My actual problem is fixed, but I'm wondering if there's a bug here. If the MEXTPG option isn't compatible with the bridge or the tap interfaces, I would have expected it to get disabled when everything gets wired up (as it did in my previous post). Or maybe there's something else wrong and turning of MEXTPG inadvertently fixes it?

25 Comments
2024/04/06
15:30 UTC

9

FreeBSD for beginners?

Considering the majority of the world 80 to 90% are end users of the default desktop environment, and therefore know nothing about what a system is in depth.

23 Comments
2024/04/06
10:51 UTC

2

/usr/sbin/deamon on FreeBSD 13.3 jail run on FreeBSD 13.2 hosts is broken

I've updated a jail to 13-3 Release and one of my service was no longer booting at start. I investigated, and found that the source of the issue is /usr/sbin/daemon silently exiting. No logs whatsoever, and return value of 0 despite not doing anything.

Took me some time to figure out what was wrong, and once I isolated the cause, I found other people speaking about the issue on TrueNAS forums.

What I found particularly annoying is the absolute lack of logging. I'd expect a failure like this to return at least a return code and not 0.

I'm writing this here for slight exposure of the issue, in hope my waste of time will avoid someone else's surprise and similar waste of time in the future.

7 Comments
2024/04/06
09:36 UTC

28

OpenBSD 7.5 released

1 Comment
2024/04/06
08:29 UTC

9

What is the purpose of destructive dtrace?

Hi, I frequently encounter this setting security.bsd.allow_destructive_dtrace set to a value of zero, like so security.bsd.allow_destructive_dtrace=0

I'm not sure whether it should be set to zero in my situation. I searched online but couldn't find much information. My intention is to use FreeBSD for desktop usage, not as a server. I would be grateful for any suggestion.

9 Comments
2024/04/05
21:05 UTC

25

pfSense® Software Embraces Change: A Strategic Migration to the Linux Kernel

...and no, this doesn't seems to be an April fool; the article is still there and it's sound.

Original post from Netgate here.

109 Comments
2024/04/03
12:26 UTC

1

Trying to add SystemD to Linux installed on the Linuxulator...

Hello.

There was a time when the developers was working on the WSL vers. 2 (Windows Subsystem for Linux),that they hadn't still developed SystemD yet. And I remember well that there was an external developer that had created a dirty but working hack to add it to WSL2. Yesterday I've thought,why not try to adapt it and make it work on Linux (on the CentOS,maybe or on the Ubuntu) that we have installed on our Linux emulation layer on FreeBSD ? I'm an hobbyst,I'm not sure if it is really needed. I want to left the judgement to you. In the meantime I'll paste the script. I'm not able to adapt the script for the purpose only by myself,but I can help....

if [ "$1" != "--force" ]; then
    if [ -f /usr/sbin/start-systemd-namespace ]; then
        echo "It appears you have already installed the systemd hack."
        echo "To forcibly reinstall, run this script with the \`--force\` parameter."
        exit
    fi
    if [ -z "$WSL_DISTRO_NAME" ]; then
        echo "It appears that you are not running on WSL."
        echo "To forcibly install anyway, run this script with the \`--force\` parameter."
        exit
    fi
fi

self_dir="$(dirname $0)"

function interop_prefix {
    win_location="/mnt/"
    if [ -f /etc/wsl.conf ]; then
        tmp="$(awk -F '=' '/root/ {print $2}' /etc/wsl.conf | awk '{$1=$1;print}')"
        [ "$tmp" == "" ] || win_location="$tmp"
        unset tmp
    fi
    echo "$win_location"

    unset win_location
}

function sysdrive_prefix {
    win_location="$(interop_prefix)"
    hard_reset=0
    for pt in $(ls "$win_location"); do
        if [ $(echo "$pt" | wc -l) -eq 1 ]; then
            if [ -d "$win_location$pt/Windows/System32" ]; then
                hard_reset=1
                win_location="$pt"
                break
            fi
        fi
    done

    if [ $hard_reset -eq 0 ]; then
        win_location="c"
    fi

    echo "$win_location"

    unset win_location
    unset hard_reset
}

sudo hwclock -s
sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig

sudo cp "$self_dir/start-systemd-namespace" /usr/sbin/start-systemd-namespace
sudo cp "$self_dir/enter-systemd-namespace" /usr/sbin/enter-systemd-namespace
sudo chmod +x /usr/sbin/enter-systemd-namespace

sudo tee /etc/sudoers.d/systemd-namespace >/dev/null <<EOF
Defaults        env_keep += WSLPATH
Defaults        env_keep += WSLENV
Defaults        env_keep += WSL_INTEROP
Defaults        env_keep += WSL_DISTRO_NAME
Defaults        env_keep += PRE_NAMESPACE_PATH
Defaults        env_keep += PRE_NAMESPACE_PWD
%sudo ALL=(ALL) NOPASSWD: /usr/sbin/enter-systemd-namespace
EOF

if ! grep 'start-systemd-namespace' /etc/bash.bashrc >/dev/null; then
  sudo sed -i 2a"# Start or enter a PID namespace in WSL2\nsource /usr/sbin/start-systemd-namespace\n" /etc/bash.bashrc
fi

sudo rm -f /etc/systemd/user/sockets.target.wants/dirmngr.socket
sudo rm -f /etc/systemd/user/sockets.target.wants/gpg-agent*.socket
sudo rm -f /lib/systemd/system/sysinit.target.wants/proc-sys-fs-binfmt_misc.automount
sudo rm -f /lib/systemd/system/sysinit.target.wants/proc-sys-fs-binfmt_misc.mount
sudo rm -f /lib/systemd/system/sysinit.target.wants/systemd-binfmt.service

if [ -f /proc/sys/fs/binfmt_misc/WSLInterop ] && [ "$(head -n1  /proc/sys/fs/binfmt_misc/WSLInterop)" == "enabled" ]; then
  "$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/cmd.exe /C setx WSLENV BASH_ENV/u
  "$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/cmd.exe /C setx BASH_ENV /etc/bash.bashrc
else
  echo
  echo "You need to manually run the following two commands in Windows' cmd.exe:"
  echo
  echo "  setx WSLENV BASH_ENV/u"
  echo "  setx BASH_ENV /etc/bash.bashrc"
  echo
fi

full script here :

https://github.com/DamionGans/ubuntu-wsl2-systemd-script/blob/master/ubuntu-wsl2-systemd-script.sh

15 Comments
2024/04/03
10:34 UTC

0

Information

Are all the technologies described in the cookbook used by the kernel?or are there portals that are no less informative about the core?

3 Comments
2024/04/03
09:50 UTC

6

Upgrade question host & jails

I wonder what it means to upgrade a host from 13.1 to 13.2 or to 14 while running a number of jails. Would I have to upgrade all the jails too? This is quite a process with questions that need to be answered, configuration files that need to be compared manually etcetera. It's not (and probably should not be) an unattended process, but can it be made one for instance by providing a configuration file with pre-made choices and default values? What is best practice in this case?

4 Comments
2024/04/02
19:25 UTC

35

Did (or would) the XZ Utils backdoor affect the BSD ecosystem at all?

This is the first thought that came up to my head as soon as this story got public.

Do any of the BSDs rely on XZ utils?
Rather did any BSD operating system even incorporate it into system by install?

36 Comments
2024/04/02
12:42 UTC

5

rc.conf.d is ignored in jail

Hello everyone,

I'm trying to setup a jail with an caddy Reverse Proxy service.

My jail.conf.d/caddy.conf File looks like this:

caddy {
  # STARTUP/LOGGING
  exec.start = "/bin/sh /etc/rc";
  exec.stop = "/bin/sh /etc/rc.shutdown";
  exec.consolelog = "/var/log/jail_console_${name}.log";

  # HOSTNAME/PATH
  host.hostname = "${name}";
  path = "/jails/${name}";

  # NETWORK
  ip4 = inherit;
}

My $jaildir/etc/rc.conf.d/caddy File looks like this:

caddy_enable="YES"

With these settings, the caddy service isn't started with the jail. However, if I put the same content into $jaildir/etc/rc.conf it is started and working properly.

Why is the rc.conf.d directory ignored in this situation?

Thanks in advance.

22 Comments
2024/04/02
07:59 UTC

5

nvmecontrol ns documentation?

Original Post:

Anyone know where I can find some detailed documentation on the "nvmecontrol ns" command and sub-command?

When i pull up the man page for "nvmecontrol", all I can find for the "ns" sub-command is "Various namespace management commands. If namespace management is supported by device, allow list, create and delete namespaces, list, attach and detach controllers to namespaces.".

Other than that, my searching has turned up little more than some git pages with source code.

Any help would be much appreciated.

Edit (2022-04-02):

I also hit up the FreeBSD Discord and asked the question there as well. Someone there was kind enough to point out that I had neglected to use the built in help. Had I used that, there is more information. But I still need to find some detail on NVMe specs to fully understand how to use all the options.

[~]# nvmecontrol ns
usage:
    nvmecontrol ns active          - List active (attached) namespaces
    nvmecontrol ns allocated       - List allocated (created) namespaces
    nvmecontrol ns attach          - Attach a controller to a namespace
    nvmecontrol ns attached        - List controllers attached to a namespace
    nvmecontrol ns controllers     - List all controllers in NVM subsystem
    nvmecontrol ns create          - Create a namespace
    nvmecontrol ns delete          - Delete a namespace
    nvmecontrol ns detach          - Detach a controller from a namespace
    nvmecontrol ns identify        - Print IDENTIFY for allocated namespace

1[~]# nvmecontrol ns create
Missing arg controller-id|namespace-id
Usage:
    nvmecontrol ns create <args> controller-id|namespace-id

Create a namespace
Options:
 -s, --nsze=<NUM>              - The namespace size
 -c, --ncap=<NUM>              - The capacity of the namespace (<= ns size)
 -f, --lbaf=<NUM>              - The FMT field of the FLBAS
 -m, --mset=<NUM>              - The MSET field of the FLBAS
 -n, --nmic=<NUM>              - Namespace multipath and sharing capabilities
 -p, --pi=<NUM>                - PI field of FLBAS
 -l, --pil=<NUM>               - PIL field of FLBAS
 -L, --flbas=<NUM>             - Namespace formatted logical block size setting
 -d, --dps=<NUM>               - Data protection settings

It's the cli options under "nvmecontrol ns create" that I am most interested in figuring out.

2 Comments
2024/04/02
02:45 UTC

43

FreeBSD in Virtual Box (My first install)

19 Comments
2024/04/02
00:39 UTC

0

Need advice rar2fs mount to jail (bastillebsd)

Hi,

Im trying to attach my rar2fs mount from host to my jail created with bastillebsd

this is my fstab for my jail:

/dataset /usr/local/bastille/jails/”jail”/root/media/dataset nullfs ro 0 0

this i how i mount the rar2fs mount on the host

rar2fs -o warmup -o allow_other --seek-length=1 /dataset /mnt/foo/bar

lsvfs:

fusefs 0x000000ed 6 synthetic, jail

how would i mount it to the jail? i tried:

dataset/foo /usr/local/bastille/jails/”jail”/root/media/foo rar2fs -o warmup -o allow_other --seek-length=1 rw 0 0

but might be the wrong approach

thanks

0 Comments
2024/04/01
19:24 UTC

17

Freebsd vs linux

I've been a linux user for the past 20 ish years and am pretty comfortable with the platform but have always seen freebsd and never tried it.

I was wondering with them both being unix based operating systems that just went in different directions, how different are they. What are the pros and cons of freebsd vs linux? Or is this something I should just try to find out?

I hear freebsd has better repositories than linux but linux has better support for things like gaming. Just curious of your opinions and thoughts for a freebsd room like myself. Also I'm not sure where the best place would be to read up on the subject.

Thanks

40 Comments
2024/04/01
04:15 UTC

4

FreeBSD, Lightdm and Fluxbox

Does anyone know how to make Lightdm recognize fluxbox? When I get to lightdm login box and I enter my password I get this:

Failed to start session

On my .xinitrc file I have this:

exec startfluxbox

I have tried symlinking .xinitrc to .xsession and .Xsession all in my home directory. I also tried adding exec startfluxbox line to my .profile file to no avail.

Any clues?

2 Comments
2024/03/31
15:04 UTC

26

Simple "weather station" with FreeBSD

3 Comments
2024/03/31
08:34 UTC

3

IPFW for a CTF challenge (Nat question)

I'm trying to work my way through a CTF, and I need to spoof a source ip coming from a freebsd box.

I was hoping to add a nat rule that catches loopback traffic to a certain port and send it out with a different source ip(Not an interface on the box)

I've done this with PF rules before, but I'm fairly new to IPFW, and most things I'm reading make it look like I'll need 2-3 different rules to make this work. One to define the nat and catch traffic, another to make the change, and another to implement keep-state?

We're suppose to be able to get this to work without breaking services which will result in points deduction, but just having and example to wrap my head around would help.

0 Comments
2024/03/30
18:50 UTC

38

Finally jumped on FreeBSD and loving the design and simplicity these books have been great!

1 Comment
2024/03/30
00:48 UTC

7

Gentoo to FreeBSD on laptop

I am thinking of moving from Gentoo to FreeBSD on my Thinkpad but I have a few questions.

How good is Wifi support? Specifically Intel Wi-Fi 6E AX211.

I know about Ports but from testing in VM they seem less flexible than Portage (I'm thinking USE flags, easy system updates, software availability), is this true?

Is the proprietary Nvidia driver for FreeBSD as good as Linux? I'd like to avoid using it but seems practically impossible for the moment whether on Linux or BSD.

I do a very limited amount of gaming, mostly Minecraft and Paradox Interactive titles which run natively on Linux. Is this likely to be a huge problem? I would expect Minecraft to work fine as it is a Java game and possibly the others would work using Linux binary compatibility?

From what I understand X11 support is pretty good so I should be able to use i3wm without much issue. I don't mind tinkering but would ideally like to be able to get to a usable daily driver laptop. I have used Gentoo for several years and am more than comfortable with the terminal and should be able to pick up BSD specific things quite quickly.

Thank you for any help!

20 Comments
2024/03/29
22:52 UTC

117

FreeBSD isnt bad for a desktop OS

25 Comments
2024/03/29
13:57 UTC

11

UFS , ZFS vs Btrfs , XFS , EXT4

Some say that ZFS is good for server backups, but it is not the optimal choice for desktop environment file systems, as it is slower to compress and decompress compared to Btrfs and XFS.
In summary, which file system is best for mid-range and low-end machines and your overall system usage either on server or desktop environment?

46 Comments
2024/03/28
10:00 UTC

Back To Top