# [Linuxulator] How to install Brave (Linux app) on FreeBSD 13.0+



## patovm04 (Feb 15, 2021)

*Important notes:*
1) This guide is for FreeBSD 13.0 and newer only!!
For FreeBSD 12, please see: https://forums.freebsd.org/threads/...-google-chrome-linux-binary-on-freebsd.77559/
2) This method should be valid for installing any other Chromium-based web browser (Google Chrome, Opera, Vivaldi, Edge, etc), as long as they (or their dependencies) are not Snaps/Flatpaks.
3) Most enhancements found in this tutorial were taken from/inspired by: https://github.com/mrclksr/linux-browser-installer
4) Given the many improvements made in Linuxulator and DRM drivers, we don't rely on games/linux-steam-utils workarounds anymore. Likewise, disabling DRI3 is no longer necessary.
5) Here we use an Ubuntu-based userspace, instead of default CentOS one.
6) Sound, webcam, microphone, hardware acceleration all properly work. Widevine support too (Netflix, Spotify, Amazon Prime Video, HBO Max, etc).
7) The /home and /tmp directories are shared by FreeBSD and Linux apps.
8) We now use /compat/ubuntu as Linux compat location, to avoid conflicting with CentOS-based ports. Still, be aware you can't run both Ubuntu and CentOS environments at the same time. When you want to switch back to running your CentOS-based applications, you'll need to disable Ubuntu rc.d script and enable the Linux one:
`sysrc ubuntu_enable=NO && sysrc linux_enable=YES`
Then reboot to make your changes take effect, or manually stop Ubuntu service and start the Linux one:
`service ubuntu onestop && sysctl compat.linux.emul_path=/compat/linux && service linux start`
9) I recommend (although is not a requirement as far as I know) to use tmpfs for /tmp. This is not the case when using ZFS default installation, but can be easily fixed. Assuming the ZFS pool is named "zroot":
# First reboot into single-user mode.
# Remount root filesystem as read/write:
`mount -u /`
# Destroy /tmp from zroot:
`zfs destroy -f zroot/tmp`
# Add this fstab entry:
`printf "tmpfs\t/tmp\ttmpfs\trw,mode=1777\t0\t0\n" >> /etc/fstab`
# Reboot back to normal multi-user mode.


Let's begin:
`su`
# Create Ubuntu rc.d script and make it executable:
`touch /usr/local/etc/rc.d/ubuntu && chmod +x /usr/local/etc/rc.d/ubuntu`

# Make it have this content:


```
#!/bin/sh
#
# PROVIDE: ubuntu
# REQUIRE: archdep mountlate
# KEYWORD: nojail
#
# This is a modified version of /etc/rc.d/linux
# Based on the script by mrclksr:
# https://github.com/mrclksr/linux-browser-installer/blob/main/rc.d/ubuntu.in
#
. /etc/rc.subr

name="ubuntu"
desc="Enable Ubuntu chroot, and Linux ABI"
rcvar="ubuntu_enable"
start_cmd="${name}_start"
stop_cmd=":"

unmounted()
{
    [ `stat -f "%d" "$1"` == `stat -f "%d" "$1/.."` -a \
      `stat -f "%i" "$1"` != `stat -f "%i" "$1/.."` ]
}

ubuntu_start()
{
    local _emul_path _tmpdir

    load_kld -e 'linux(aout|elf)' linux
    case `sysctl -n hw.machine_arch` in
    amd64)
        load_kld -e 'linux64elf' linux64
        ;;
    esac
    if [ -x /compat/ubuntu/sbin/ldconfigDisabled ]; then
        _tmpdir=`mktemp -d -t linux-ldconfig`
        /compat/ubuntu/sbin/ldconfig -C ${_tmpdir}/ld.so.cache
        if ! cmp -s ${_tmpdir}/ld.so.cache /compat/ubuntu/etc/ld.so.cache; then
            cat ${_tmpdir}/ld.so.cache > /compat/ubuntu/etc/ld.so.cache
        fi
        rm -rf ${_tmpdir}
    fi

    # Linux uses the pre-pts(4) tty naming scheme.
    load_kld pty

    # Handle unbranded ELF executables by defaulting to ELFOSABI_LINUX.
    if [ `sysctl -ni kern.elf64.fallback_brand` -eq "-1" ]; then
        sysctl kern.elf64.fallback_brand=3 > /dev/null
    fi

    if [ `sysctl -ni kern.elf32.fallback_brand` -eq "-1" ]; then
        sysctl kern.elf32.fallback_brand=3 > /dev/null
    fi
    sysctl compat.linux.emul_path=/compat/ubuntu

    _emul_path="/compat/ubuntu"
    unmounted "${_emul_path}/dev" && (mount -o nocover -t devfs devfs "${_emul_path}/dev" || exit 1)
    unmounted "${_emul_path}/dev/fd" && (mount -o nocover,linrdlnk -t fdescfs fdescfs "${_emul_path}/dev/fd" || exit 1)
    unmounted "${_emul_path}/dev/shm" && (mount -o nocover,mode=1777 -t tmpfs tmpfs "${_emul_path}/dev/shm" || exit 1)
    unmounted "${_emul_path}/home" && (mount -t nullfs /home "${_emul_path}/home" || exit 1)
    unmounted "${_emul_path}/proc" && (mount -o nocover -t linprocfs linprocfs "${_emul_path}/proc" || exit 1)
    unmounted "${_emul_path}/sys" && (mount -o nocover -t linsysfs linsysfs "${_emul_path}/sys" || exit 1)
    unmounted "${_emul_path}/tmp" && (mount -t nullfs /tmp "${_emul_path}/tmp" || exit 1)
    unmounted /dev/fd && (mount -o nocover -t fdescfs fdescfs /dev/fd || exit 1)
    unmounted /proc && (mount -o nocover -t procfs procfs /proc || exit 1)
    true
}

load_rc_config $name
run_rc_command "$1"
```

# Enable Linux compatibility layer (Ubuntu):
`sysrc ubuntu_enable=YES`

# Create necessary mount points for a working Linuxulator:
`mkdir -p {/compat/ubuntu/dev/fd,/compat/ubuntu/dev/shm,/compat/ubuntu/home,/compat/ubuntu/tmp,/compat/ubuntu/proc,/compat/ubuntu/sys}`

# Start Ubuntu service:
`service ubuntu start`

# Install needed packages:
`pkg install debootstrap pulseaudio`

# Install Ubuntu 20.04 into /compat/ubuntu:
`debootstrap --arch=amd64 --no-check-gpg focal /compat/ubuntu`

# Restart Ubuntu service to make sure everything is properly mounted:
`service ubuntu restart`

# Fix broken symlink:
`cd /compat/ubuntu/lib64/ && rm ./ld-linux-x86-64.so.2 ; ln -s ../lib/x86_64-linux-gnu/ld-2.31.so ld-linux-x86-64.so.2`

# Chroot into your Linux environment:
`chroot /compat/ubuntu /bin/bash`

# Set correct timezone inside your chroot:
`printf "%b\n" "0.0 0 0.0\n0\nUTC" > /etc/adjtime`
`sudo dpkg-reconfigure tzdata`  # For some reason sudo is necessary here, otherwise it fails.

# Fix APT package manager:
`printf "APT::Cache-Start 251658240;" > /etc/apt/apt.conf.d/00aptitude`

# Enable more repositories:
`printf "deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse" > /etc/apt/sources.list`

# Install required programs:
`apt update ; apt install -y apt-transport-https curl fonts-symbola gnupg pulseaudio`

# Add Brave signing key:
`curl -s https://brave-browser-apt-release.s3.brave.com/brave-core.asc | apt-key --keyring /etc/apt/trusted.gpg.d/brave-browser-release.gpg add -`

# Add Brave repository:
`echo "deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" | tee /etc/apt/sources.list.d/brave-browser-release.list`

# Install Brave web browser:
`apt update ; apt install -y brave-browser`

# Exit chroot:
`exit`

# Create custom Brave wrapper script (based on the one provided by the program itself):
`touch /compat/ubuntu/opt/brave.com/brave/brave-wrapper && chmod +x /compat/ubuntu/opt/brave.com/brave/brave-wrapper`

# Make it contain this:


```
#!/compat/ubuntu/bin/bash
#
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

HERE="/opt/brave.com/brave"

# We include some xdg utilities next to the binary, and we want to prefer them
# over the system versions when we know the system versions are very old. We
# detect whether the system xdg utilities are sufficiently new to be likely to
# work for us by looking for xdg-settings. If we find it, we leave $PATH alone,
# so that the system xdg utilities (including any distro patches) will be used.
if ! which xdg-settings &> /dev/null; then
  # Old xdg utilities. Prepend $HERE to $PATH to use ours instead.
  export PATH="$HERE:$PATH"
else
  # Use system xdg utilities. But first create mimeapps.list if it doesn't
  # exist; some systems have bugs in xdg-mime that make it fail without it.
  xdg_app_dir="${XDG_DATA_HOME:-$HOME/.local/share/applications}"
  mkdir -p "$xdg_app_dir"
  [ -f "$xdg_app_dir/mimeapps.list" ] || touch "$xdg_app_dir/mimeapps.list"
fi

# Always use our versions of ffmpeg libs.
# This also makes RPMs find the compatibly-named library symlinks.
if [[ -n "$LD_LIBRARY_PATH" ]]; then
  LD_LIBRARY_PATH="$HERE:$HERE/lib:$LD_LIBRARY_PATH"
else
  LD_LIBRARY_PATH="$HERE:$HERE/lib"
fi
export LD_LIBRARY_PATH

export CHROME_VERSION_EXTRA="stable"

# We don't want bug-buddy intercepting our crashes. http://crbug.com/24120
export GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME

# Sanitize std{in,out,err} because they'll be shared with untrusted child
# processes (http://crbug.com/376567).
exec < /dev/null
exec > >(exec cat)
exec 2> >(exec cat >&2)

"$HERE/brave" --no-sandbox --test-type --v=0 "$@" || true
```

# Now create linux-brave launcher script and make it executable:
`touch /usr/local/bin/linux-brave && chmod +x /usr/local/bin/linux-brave`

# Edit it so it has this content:


```
#!/bin/sh

# Ensure having working sound, independently of the DE/WM in use:
get_pa_sock_path()
{
        PA_SOCK_PATH=$(sockstat | awk -v me=$(whoami) -F'[ \t]+' '
                $1 == me && $2 == "pulseaudio" && $6 ~ /native/ {
                        print $6;
                        exit 0
                }'
        )
}

get_pa_sock_path
if [ ! -S "$PA_SOCK_PATH" ]; then
        while killall pulseaudio; do
                sleep 0.5
        done
        pulseaudio --start
        get_pa_sock_path
fi
[ -S "$PA_SOCK_PATH" ] && export PULSE_SERVER=unix:$PA_SOCK_PATH

# Let the wrapped binary know that it has been run through the wrapper:
export CHROME_WRAPPER="`readlink -f "$0"`"

# Launch Brave through our custom brave-wrapper script:
/compat/ubuntu/opt/brave.com/brave/brave-wrapper "$@"
```

# Exit su:
`exit`

# Finally, make a .desktop file to launch Brave as any other app:
`touch ~/.local/share/applications/brave-browser.desktop && chmod +x ~/.local/share/applications/brave-browser.desktop`

# Make it look like this:


```
[Desktop Entry]
Type=Application
Version=1.0
Encoding=UTF-8
Name=Brave Web Browser
Comment=Access the Internet
Icon=brave-browser
Exec=/usr/local/bin/linux-brave %U
Categories=Application;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;
StartupNotify=true
```

**Notice:* Accessing your google account won't work. It will display something like this:
_"Couldn't sign you in This browser or app may not be secure. Try using a different browser. If you’re already using a supported browser, you can refresh your screen and try again to sign in."_

To fix this, change your user agent to a non-chromium web browser, like Firefox for instance, and login to Gmail or any other google service (making sure to keep logged in). After this you can change your user agent back to default.
The good thing is you won't need to repeat this step later, not even when logging-in to a different account .
For reference, this extension worked for me: User-Agent Switcher and Manager


That's all!

*Sources:*
https://wiki.freebsd.org/LinuxJails
https://wiki.freebsd.org/LinuxApps
https://wiki.freebsd.org/Linuxulator
https://help.ubuntu.com/lts/installation-guide/armhf/apds04.html
https://github.com/AppImage/AppImageKit/issues/98
https://pastebin.com/1W9Fh3e9
https://github.com/mrclksr/linux-browser-installer

*EDIT 1:*
-Changed compat location to /compat/ubuntu and added Ubuntu rc.d script to avoid conflicts with CentOS-based ports.
-Modified Brave wrapper script to resemble better the one provided by Brave itself. Also dropped --no-zygote flag.

*EDIT 2:*
-Fixed sound for PWAs too.

*EDIT 3:*
-Added "Restart Ubuntu service" immediately after running debootstrap, to make sure everything needed is properly mounted.


----------



## shkhln (Feb 15, 2021)

I think you should be able to drop --no-zygote. And _definitely_ get rid of --test-type, this flag does nothing useful.



patovm04 said:


> 8) I've opted to use /compat/linux location instead of /compat/ubuntu, as CentOS and Ubuntu based environments can't both run at the same time anyway. Still, this is discouraged by some people, for it conflicts with CentOS-based ports. This means you need to remove any linux-c7* port you may have and avoid installing them afterwards too.


Well, it conflicts with my port and I don't like it.


----------



## scottro (Feb 15, 2021)

I didn't check this line by line for the differences between it and your 12.2 guide. However, I used your 12.2 guide with 13.0-BETA1 and it worked without problems.  (Also wanted to thank you for an older tutorial, the one about multibooting with ZFS only on the FreeBSD partition. I haven't yet tried that one, but I think, when 13 becomes full RELEASE, I'm going to do so.)

I am guessing one difference is the script one creates, and that this may eliminate the need for the one provided in the last tutorial by mrclksr 
to ensure sound works.  
Again, I think this is important stuff, because it enables people with just one computer to run Netflix, Amazon prime video, and the like.

Easy for me to say, without doing anything, but it would be nice if there were a way to do it without conflicting with other ports.


----------



## patovm04 (Feb 15, 2021)

shkhln said:


> I think you should be able to drop --no-zygote. And _definitely_ get rid of --test-type, this flag does nothing useful.
> 
> 
> Well, it conflicts with my port and I don't like it.


Thanks for the feedback. I dropped ---no-zygote flag as suggested, but kept --test-type for it prevents the annoying warning message about running without sandbox from showing up each time you open the browser.
I also did some modifications to avoid conflicts with CentOS ports!


----------



## patovm04 (Feb 15, 2021)

scottro said:


> I didn't check this line by line for the differences between it and your 12.2 guide. However, I used your 12.2 guide with 13.0-BETA1 and it worked without problems.  (Also wanted to thank you for an older tutorial, the one about multibooting with ZFS only on the FreeBSD partition. I haven't yet tried that one, but I think, when 13 becomes full RELEASE, I'm going to do so.)
> 
> I am guessing one difference is the script one creates, and that this may eliminate the need for the one provided in the last tutorial by mrclksr
> to ensure sound works.
> ...


You're welcome!
If you want, check this guide again as I changed a fair bit of it!
It doesn't conflict with CentOS ports anymore, and there are other changes too


----------



## scottro (Feb 15, 2021)

Wow, that's great. I'll give it a try. I did, when last trying it, have to use mrclksr's script to fix sound, and I'm wondering if your new one eliminates the need for that.  I will give it a try and update this thread. (I don't know if it will be today).


----------



## scottro (Feb 16, 2021)

Ok, I tried it on a fresh 13.0-BETA2 install. Had a few hiccups, which I assume were my mistakes, (first time debootstrap didn't fully install it, stuff like that), but I cleared out compat again. (First remembering to stop the rc.d ubuntu service, as otherwise, doing rm -rf cleans out my home directory) 

Anyway, after a few tries, it works perfectly. I don't make the .desktop file because I start it with a keyboard shortcut from openbox, and with dmenu from dwm.  
I don't want to get repetitive, but thanks again for your work with this, I do think that the more support desktop BSD gets, the more  both hardware and software vendors will consider supporting it.


----------



## patovm04 (Feb 16, 2021)

scottro said:


> Ok, I tried it on a fresh 13.0-BETA2 install. Had a few hiccups, which I assume were my mistakes, (first time debootstrap didn't fully install it, stuff like that), but I cleared out compat again. (First remembering to stop the rc.d ubuntu service, as otherwise, doing rm -rf cleans out my home directory)
> 
> Anyway, after a few tries, it works perfectly. I don't make the .desktop file because I start it with a keyboard shortcut from openbox, and with dmenu from dwm.
> I don't want to get repetitive, but thanks again for your work with this, I do think that the more support desktop BSD gets, the more  both hardware and software vendors will consider supporting it.


Thanks for the feedback! Added another small correction


----------



## shiorid (Feb 18, 2021)

Awesome guide! Thank you!

Just as a side note;
If you're running some Wayland compositor (like x11-wm/sway  or x11-wm/hikari) instead of an X.org session, your $XDG_RUNTIME_DIR should be set to /tmp_._ In that case, you wouldn't be able to start PulseAudio, receiving the following error:
`E: [(null)] core-util.c: XDG_RUNTIME_DIR (/tmp) is not owned by us (uid 1001), but by uid 0! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)`
As a solution, you can set the $XDG_RUNTIME_DIR local variable to an owned directory like:
`XDG_RUNTIME_DIR=$HOME/.tmp linux-brave`


----------



## obiwac (Feb 22, 2021)

> First remembering to stop the rc.d ubuntu service, as otherwise, doing rm -rf cleans out my home directory


Ashamed to admit this has happened to me on more than one occasion


----------



## brunoerusso (Mar 2, 2021)

patovm04 said:


> *Important notes:*
> 1) This guide is for FreeBSD 13.0 and newer only!!
> For FreeBSD 12, please see: https://forums.freebsd.org/threads/...-google-chrome-linux-binary-on-freebsd.77559/
> 2) This method should be valid for installing any other Chromium-based web browser (Google Chrome, Opera, Vivaldi, Edge, etc), as long as they (or their dependencies) are not Snaps/Flatpaks.
> ...


Hi all! Thanks, good job, but it doesn't work for me with focal. When debootstrap is working has a systemd error while unpacking base files. I've used bionic and Brave runs great! Nice job!
Best regards.


----------



## tyson (Mar 10, 2021)

This guide is amazing. I used this to setup Chrome, because Brave is not allowing to use non-shop extensions (netflix 1080p force).
Works perfect.


----------



## ashleymills (Mar 19, 2021)

Thanks for your efforts on this. Everything works fine, netflix etc fantastic. However I have one issue. I have a titan key setup with my google account so when I try and login to google it tries to probe udev, which causes a segfault:


```
ERROR:bus.cc(393)] Failed to connect to the bus: Did not receive a reply.
...
ERROR:udev_watcher.cc(51)] Failed to initialize a udev monitor.
```

If I chroot into /compat/ubuntu I can't start udev or dbus, should I be able to? Or am I completely misunderstanding something?


----------



## Lars Skogstad (Apr 23, 2021)

```
[65780:100636:0423/161030.566908:ERROR:file_path_watcher_linux.cc(316)] inotify_init() failed: Function not implemented (38)
[65780:65780:0423/161030.569228:ERROR:browser_main_loop.cc(536)] Failed to open an X11 connection.
[65780:65780:0423/161030.569330:ERROR:browser_main_loop.cc(1386)] Unable to open X display.
```
Tried as normal user and root.


----------



## vikashb (Jun 17, 2021)

Thanks for the guide,

when i try to update the widevine component i get the following error:

[3535:102516:0617/151107.300660:ERROR:zygote_host_impl_linux.cc(264)] Failed to adjust OOM score of renderer with pid 3653: No such file or directory (2)
[3535:102533:0617/151107.350891:ERROR:component_installer.cc(141)] Move failed.: Socket operation on non-socket (88)

the following shows up as well:

linux: jid 0 pid 6700 (ThreadPoolForeg): unsupported getsockopt level 6 optname 11
linux: jid 0 pid 6700 (ThreadPoolForeg): unsupported getsockopt level 6 optname 11
linux: jid 0 pid 6700 (ThreadPoolForeg): unsupported getsockopt level 6 optname 11
linux: jid 0 pid 6700 (ThreadPoolForeg): unsupported getsockopt level 6 optname 11
linux: jid 0 pid 6700 (ThreadPoolForeg): unsupported getsockopt level 6 optname 11
linux: jid 0 pid 6700 (ThreadPoolForeg): unsupported getsockopt level 6 optname 11
linux: jid 0 pid 6700 (ThreadPoolForeg): unsupported getsockopt level 6 optname 11
linux: jid 0 pid 6700 (ThreadPoolForeg): unsupported getsockopt level 6 optname 11
linux: jid 0 pid 6700 (ThreadPoolForeg): unsupported getsockopt level 6 optname 11

any ideas ?


----------



## Holger (Aug 9, 2021)

Thank you for this guide!

I used it successfully to run Google Chrome (Widewine did not work in Brave, but does in Chrome) but there was no sound, neither in Brave nor in Chrome.

Reason was that Chrome (resp. Brave) took too long to start-up, which made Pulseaudio quit because of being idle (this is normal behavior). Solution is to change the start-up of Pulseaudio in the `linux-brave` script, line 19, as follows

```
pulseaudio --start --exit-idle-time=3600
```

This gives the application 3600 seconds to start-up, which should be enough. If you want to disable this "feature" (quitting because of being idle) of Pulseaudio, use "-1". See `man pulseaudio`


----------



## SteamBSD (Sep 19, 2021)

I try

```
debootstrap --arch=amd64 --no-check-gpg focal /compat/ubuntu
```
but error:

```
I: Retrieving Packages
I: Validating Packages
ELF interpreter /lib64/ld-linux-x86-64.so.2 not found, error 2
W: Retrying failed download of http://archive.ubuntu.com/ubuntu/dists/focal/main/binary-amd64/Packages.xz
```


----------



## jardows (Sep 22, 2021)

Tried this, everything went well until I launch Brave, and all I get is a blank window.  I've done this twice, first in a VM that uses Fluxbox, and secondly on my laptop that uses XFCE.  Any ideas?

Edit:  Here's the output of the terminal when I launch from there, if this gives any ideas.  Lots of error messages, but I'm not sure where to start:



```
[64164:101078:0922/105525.006864:ERROR:file_path_watcher_linux.cc(326)] inotify_init() failed: Function not implemented (38)
[64164:101084:0922/105525.087607:ERROR:bus.cc(392)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[64164:101077:0922/105525.089461:ERROR:address_tracker_linux.cc(195)] Could not create NETLINK socket: Address family not supported by protocol (97)
[64164:101083:0922/105525.089598:ERROR:bus.cc(392)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[64164:101083:0922/105525.089686:ERROR:bus.cc(392)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[64164:101078:0922/105525.090453:ERROR:udev_watcher.cc(52)] Failed to initialize a udev monitor.
[64164:101089:0922/105525.092670:ERROR:zygote_host_impl_linux.cc(264)] Failed to adjust OOM score of renderer with pid 66030: No such file or directory (2)
[64164:101083:0922/105525.100312:ERROR:bus.cc(392)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[64164:101083:0922/105525.100575:ERROR:bus.cc(392)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[64164:101089:0922/105525.101629:ERROR:zygote_host_impl_linux.cc(264)] Failed to adjust OOM score of renderer with pid 66233: No such file or directory (2)
[66098:101099:0922/105525.121168:ERROR:address_tracker_linux.cc(195)] Could not create NETLINK socket: Address family not supported by protocol (97)
[66098:101101:0922/105525.121167:ERROR:file_path_watcher_linux.cc(326)] inotify_init() failed: Function not implemented (38)
[64164:101089:0922/105525.141714:ERROR:zygote_host_impl_linux.cc(264)] Failed to adjust OOM score of renderer with pid 66275: No such file or directory (2)
[64164:101089:0922/105525.144637:ERROR:zygote_host_impl_linux.cc(264)] Failed to adjust OOM score of renderer with pid 66716: No such file or directory (2)
[64164:101083:0922/105525.195923:ERROR:bus.cc(392)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[64164:101083:0922/105525.196108:ERROR:bus.cc(392)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[64164:101089:0922/105525.214467:ERROR:zygote_host_impl_linux.cc(264)] Failed to adjust OOM score of renderer with pid 67141: No such file or directory (2)
[64164:101140:0922/105525.291547:ERROR:bus.cc(392)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[64164:101140:0922/105525.291666:ERROR:bus.cc(392)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[64164:101140:0922/105525.291816:ERROR:bus.cc(392)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[64164:101140:0922/105525.291926:ERROR:bus.cc(392)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[64164:101140:0922/105525.292040:ERROR:bus.cc(392)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[64164:64164:0922/105525.437513:ERROR:CONSOLE(1)] "[Shields]: Can't request shields panel data. Error: No tab url specified", source: chrome-extension://mnojpmjdmbbfmejpflffifhffcmidifd/out/brave_extension_background.bundle.js (1)
^Cjacob@maccool:~/.local/share/applications $
```


----------



## patovm04 (Sep 25, 2021)

jardows said:


> Tried this, everything went well until I launch Brave, and all I get is a blank window.  I've done this twice, first in a VM that uses Fluxbox, and secondly on my laptop that uses XFCE.  Any ideas?
> 
> Edit:  Here's the output of the terminal when I launch from there, if this gives any ideas.  Lots of error messages, but I'm not sure where to start:
> 
> ...


It started happening the same to me since Chromium v92.
I ended up solving it by adding "--in-process-gpu" flag to the Brave wrapper script, so the last line looks like this:

```
"$HERE/brave" --no-sandbox --in-process-gpu --test-type --v=0 "$@" || true
```
It may also be necessary to re-add "--no-zygote" as well to silence those loads of zygote-related output messages...


----------



## jardows (Sep 27, 2021)

patovm04 said:


> It started happening the same to me since Chromium v92.
> I ended up solving it by adding "--in-process-gpu" flag to the Brave wrapper script, so the last line looks like this:
> 
> ```
> ...


That worked great.  I'm typing this reply from the Brave browser on my FreeBSD VM.  Thanks for your hard work!


----------



## tuxador (Sep 27, 2021)

I'm unable to connect to my Google account from chrome, thus no add-ons.
How could I bypass the user agent to be able to connect to my Google account?


----------



## patovm04 (Sep 28, 2021)

tuxador said:


> I'm unable to connect to my Google account from chrome, thus no add-ons.
> How could I bypass the user agent to be able to connect to my Google account?


You can launch Brave one-off like this:
`/compat/ubuntu/opt/brave.com/brave/brave-wrapper --user-agent="Mozilla/5.0 (X11; FreeBSD amd64; Linux x86_64)"`
to be able to login to your Google account. If you don't log out you won't need to keep doing this.


----------



## justfly1111 (Oct 20, 2021)

so i got signed into google etc. but i cant use/download any extensions or themes when i try it says 
An error has occurred​Could not install package: 'FAILED_TO_COPY_EXTENSION_FILE_TO_TEMP_DIRECTORY'

any ideas for a work around i tried chmod 777 my tmpfs dir etc no dice. any help is appreciated as is you time thanks guys.


----------



## eternal_noob (Oct 20, 2021)

justfly1111 said:


> FAILED_TO_COPY_EXTENSION_FILE_TO_TEMP_DIRECTORY


Maybe one of these threads has a solution: https://forums.freebsd.org/search/228616/?q=FAILED_TO_COPY_EXTENSION_FILE_TO_TEMP_DIRECTORY&o=date


----------



## vikashb (Oct 21, 2021)

justfly1111 said:


> so i got signed into google etc. but i cant use/download any extensions or themes when i try it says
> An error has occurred​Could not install package: 'FAILED_TO_COPY_EXTENSION_FILE_TO_TEMP_DIRECTORY'
> 
> any ideas for a work around i tried chmod 777 my tmpfs dir etc no dice. any help is appreciated as is you time thanks guys.



i get this error as well:
[45357:397597:1021/092223.665754:ERROR:component_installer.cc(143)] Move failed.: Socket operation on non-socket (88)
[45357:397600:1021/092225.049482:ERROR:component_installer.cc(143)] Move failed.: Socket operation on non-socket (88)
[45357:397600:1021/092226.580514:ERROR:component_installer.cc(143)] Move failed.: Socket operation on non-socket (88)
[45357:397600:1021/092228.592985:ERROR:component_installer.cc(143)] Move failed.: Socket operation on non-socket (88)

are you seeing the same error ?


----------



## Rand0m (Nov 8, 2021)

justfly1111 said:


> so i got signed into google etc. but i cant use/download any extensions or themes when i try it says
> An error has occurred​Could not install package: 'FAILED_TO_COPY_EXTENSION_FILE_TO_TEMP_DIRECTORY'
> 
> any ideas for a work around i tried chmod 777 my tmpfs dir etc no dice. any help is appreciated as is you time thanks guys.


Hi justfly1111 , I have the same issue so I wonder if you were able to solve it.

patovm04 great work thanks so much, I finally can watch netflix and prime video on my freeBSD.


----------



## tuxador (Nov 8, 2021)

Rand0m said:


> Hi justfly1111 , I have the same issue so I wonder if you were able to solve it.
> 
> patovm04 great work thanks so much, I finally can watch netflix and prime video on my freeBSD.


should we mount a /tmp folder on the linux chroot before attempting to install the extension ?


----------



## patovm04 (Nov 8, 2021)

Rand0m said:


> Hi justfly1111 , I have the same issue so I wonder if you were able to solve it.
> 
> patovm04 great work thanks so much, I finally can watch netflix and prime video on my freeBSD.


Thanks, but unfortunately the 'FAILED_TO_COPY_EXTENSION_FILE_TO_TEMP_DIRECTORY' problem doesn't seem to be a Linuxulator one. Native Chromium package on FreeBSD has the same issue nowadays. See:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258573


----------



## BawdyAnarchist (Nov 19, 2021)

A few tips for anyone trying to do this inside of a jail:

You need to run the `debootstrap` from the host, and not from inside of the running jail.   `apt update && apt upgrade` and also for adding packages, it's probably best to `chroot` directly from the host, and again, not as root from within the running jail.

The mounts should all be put into the jail's fstab, not the host fstab. This includes the .X11-UNIX nullfs mount to make x11 apps work.

I tried the procedure given by OP, but I get all kinds of errors when trying to launch the browser.

Here's my errors for Brave:


```
[95941:151292:1119/011714.451754:ERROR:file_path_watcher_linux.cc(326)] inotify_init() failed: Function not implemented (38)
[95941:151298:1119/011714.493080:ERROR:bus.cc(393)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[95941:151291:1119/011714.494743:ERROR:address_tracker_linux.cc(196)] Could not create NETLINK socket: Address family not supported by protocol (97)
[95941:151297:1119/011714.494781:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[95941:151297:1119/011714.494827:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[95941:151293:1119/011714.496328:ERROR:udev_watcher.cc(52)] Failed to initialize a udev monitor.
```

I was able to download and run spotify-client in the jailed linuxulator; logged in, but I was unable to get any sound. I'm pretty sure this is because pulseaudio is not detecting any sound devices.  I checked the availability of my normal dsp by chroot into the /compat/ubuntu directory (while inside the running jail), and `cat /dev/urandom > /dev/dsp0` definitely causes noise. When trying to manually start pulseaudio, here's what I get

```
linux@linux:~ % pulseaudio
W: [(null)] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
W: [(null)] module-detect.c: failed to detect any sound hardware.
E: [(null)] module.c: Failed to load module "module-detect" (argument: ""): initialization failed.
```


----------



## MarcoB (Nov 21, 2021)

I installed the .pkg from https://people.freebsd.org/~rodrigo/chromium/ and solved the FAILED_TO_COPY_EXTENSION_FILE_TO_TEMP_DIRECTORY-problem


----------



## Rand0m (Nov 28, 2021)

BawdyAnarchist said:


> A few tips for anyone trying to do this inside of a jail:
> 
> You need to run the `debootstrap` from the host, and not from inside of the running jail.   `apt update && apt upgrade` and also for adding packages, it's probably best to `chroot` directly from the host, and again, not as root from within the running jail.
> 
> ...


Hi BawdyAnarchist 
Can you please share the complete steps for letting this work from inside a jail? I use qjail to manage my jails. But never tried to run x from inside the jail before.


----------



## BawdyAnarchist (Nov 30, 2021)

Rand0m said:


> Hi BawdyAnarchist
> Can you please share the complete steps for letting this work from inside a jail? I use qjail to manage my jails. But never tried to run x from inside the jail before.


For linuxulator jails? Or just regular jails?

The way to get X11 apps working inside of a jail looks like this:

1. Obviously you need X11 installed to host.
2. Install X11 in your jail, along with any video card drivers (like nvidia-driver)
3. You need the following line in the jail's fstab

```
#  Device                #Mountpoint                               FStype    Options       Dump       Pass#
/tmp/.X11-unix        /jails/yourguijail/tmp/.X11-unix              nullfs       rw               0                0
```
    -- or you can just hand mount it `mount_nullfs /tmp/.X11-unix /jails/yourguijail/tmp/.X11-unix`
4. `xhost + local:`  (on host)
5. /etc/devfs.rules needs to unhide a few devices under a custom ruleset. I'm including the sound devices as well here:

```
add path 'mixer*' unhide
add path 'dsp*' unhide
add path 'video*' unhide
# If you have an nvidia card, just this line below and you're done
add path 'nvidia*' unhide
# If you have AMD, you'll need these as well
add path dri unhide
add path 'dri/*' unhide
add path drm unhide
add path 'drm/*' unhide
add path pci unhide
# At least I think that's what I needed when I played with an AMD GPU.
# Maybe that last line about PCI is unnecessary, you'll have to confirm with someone else
```
    -- Make sure to add that ruleset for your jail in /etc/jail.conf
`service devfs restart`
6. Inside the jail you need to export `setenv display :0`   To make it persistent, put it inside jail's .cshrc or .shrc

That should be it. Hopefully I haven't missed anything.


I'm really close to being finished with a whole package solution for managing jails in a way that's quite secure, quite convenient, and of course X11 working. It's basically just a set of scripts that act as a wrapper for jail management, kind of like the other options out there.

It's all actually working great for me for like a year now, I just haven't gotten around to cleaning it up; and then packaging it with a nice installer script. I'm hoping in the next few days to be finished with it, and I'll drop it onto github.


----------



## Rand0m (Dec 2, 2021)

BawdyAnarchist said:


> For linuxulator jails? Or just regular jails?
> 
> The way to get X11 apps working inside of a jail looks like this:
> 
> ...


Thanks so much, I will give it a try this weekend.


----------



## Oleg_NYC (Dec 12, 2021)

When I type 





> linux-brave &


, the browser doesn't launch and I get this output:

```
No matching processes belonging to you were found
W: [(null)] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
/compat/ubuntu/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
[2849:103486:1212/165854.170811:ERROR:file_path_watcher_linux.cc(326)] inotify_init() failed: Function not implemented (38)
[1212/165854.173759:ERROR:ptracer.cc(476)] Unexpected registers size 0 != 216, 68
[1212/165854.173846:ERROR:proc_task_reader.cc(45)] format error
/compat/ubuntu/opt/brave.com/brave/brave-wrapper: line 45: 2849 Trace/breakpoint trap "$HERE/brave" --no-sandbox --test-type --v=0 "$@"
```
Please tell me what I did wrong.


----------



## Oleg_NYC (Dec 13, 2021)

Okay, I figured out what the problem was. I had to enable xwayland! I think your HOWTO has a major omission: it doesn't state that the linuxulator is incompatible with the pure wayland experience. I also had to add --in-process-gpu to the brave-wrapper script.
Or maybe it's possible to run linuxulator in the pure wayland environment, but your HOWTO doesn't explain what has to be done in order for that to happen?
Anyway, thank you!


----------



## Oleg_NYC (Dec 15, 2021)

I just found out that it is indeed possible to run linuxulator graphical apps on freebsd when xwayland is disabled. If I add these flags to your brave-wrapper script: 
	
	



```
--enable-features=UseOzonePlatform --ozone-platform=wayland
```
, brave will load in the pure wayland environment.


----------



## priyadarshan (Dec 18, 2021)

BawdyAnarchist said:


> [...]
> 
> I'm really close to being finished with a whole package solution for managing jails in a way that's quite secure, quite convenient, and of course X11 working. It's basically just a set of scripts that act as a wrapper for jail management, kind of like the other options out there.
> 
> It's all actually working great for me for like a year now, I just haven't gotten around to cleaning it up; and then packaging it with a nice installer script. I'm hoping in the next few days to be finished with it, and I'll drop it onto github.



Thank you, looking forward to to it.


----------



## Oleg_NYC (Dec 23, 2021)

I hope I am not going too off-topic with this question, but I am just curious: on FreeBSD, is it possible to compile chromium inside the ubuntu chroot environment, move the widevinecdm folder from the extracted chrome .deb file to the chromium browser folder, and then watch Netflix? The latest unstable chromium fixed some bugs that the latest unstable chrome still has; that's why I am asking this.


----------



## Holger (Jan 10, 2022)

Just did the tutorial on a fresh install and got the following:

```
/home/hsebert % linux-brave 
No matching processes belonging to you were found
W: [(null)] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
[0111/003445.437899:ERROR:icu_util.cc(150)] Can't find icudtl.dat
[0111/003445.437977:ERROR:icu_util.cc(243)] Invalid file descriptor to ICU data received.
/compat/ubuntu/opt/brave.com/brave/brave-wrapper: line 45: 28326 Trace/breakpoint trap   (core dumped) "$HERE/brave" --in-process-gpu --no-sandbox --test-type --v=0 "$@"
```

The file icudtl.dat is there in /compat/ubuntu/brave.com/brave, but `brave` cannot find it. Any ideas?


----------



## Bluey (Mar 29, 2022)

Amazing. It still works. 13.1-BETA3 Cinnamon.

For dummies, life would be a little clearer to just put in the text editor code. I understand everyone uses a different one, but dummies trying this don't have one at all.

So for dummies trying to get Netflix working on FreeBSD, where it says, for example:

```
# Create Ubuntu rc.d script and make it executable:
touch /usr/local/etc/rc.d/ubuntu && chmod +x /usr/local/etc/rc.d/ubuntu

# Make it have this content:
Code:
```

Do this:
$ `vi /usr/local/etc/rc.d/ubuntu`
Press `<shift>-<A>`  # vi append command
Copy and paste the code.
Press `<esc> :wq!`

Support for 1080p:
https://chrome.google.com/webstore/detail/netflix-1080p/cankofcoohmbhfpcemhmaaeennfbnmgp/related


----------



## grahamperrin@ (Apr 1, 2022)

patovm04 said:


> …
> # Destroy /tmp from zroot:
> `zfs destroy -f zroot/tmp`
> …



I prefer to not mount it: 


```
% zfs get canmount,mountpoint august/tmp
NAME        PROPERTY    VALUE       SOURCE
august/tmp  canmount    off         received
august/tmp  mountpoint  /tmp        local
%
```


----------



## Bluey (Apr 1, 2022)

From what I read, there were pro and cons of using tmpfs vs zroot/tmp. So I elected to leave it as zroot/tmp. Netflix on my FreeBSD-13.1-BETA3 is more functional and stable than Cinnamon/Gnome trying to get missing settings to work.

Now using KDE Plasma X11 - fully functional.


----------



## grahamperrin@ (Apr 11, 2022)

Bluey said:


> Trying KDE. Appears fully functional, apart from Brave/Netflix - have to reinstall.



Do you mean that a working installation of Brave for Linux ceased working, after installation of KDE Plasma for FreeBSD?

If so: which method did you follow to install Plasma?


----------



## Bluey (Apr 11, 2022)

grahamperrin said:


> Do you mean that a working installation of Brave for Linux ceased working, after installation of KDE Plasma for FreeBSD?
> 
> If so: which method did you follow to install Plasma?


Yes. Everything that can be installed using `# pkg install` is what I have used.  After reinstalling something, it is working fine.

Currently 13.1-RC2.


----------



## grahamperrin@ (Apr 12, 2022)

Bluey said:


> … Everything that can be installed using `# pkg install` …



For KDE Plasma, that's typically three packages:

`pkg install --quiet --yes kde5 sddm xorg`

<https://community.kde.org/FreeBSD/Setup#KDE_and_the_rest>

I don't see how any of those three (or the dependencies) would conflict with what's in the opening post <https://forums.freebsd.org/posts/494219>, but



Bluey said:


> … After reinstalling something, it is working fine.



That's good.


----------



## Bluey (Apr 13, 2022)

grahamperrin said:


> I don't see how any of those three (or the dependencies) would conflict with what's in the opening post



[This stuff maybe better in another thread.]

Having had trouble getting X to work in the beginning and then playing with Cinnamon, XFCE and plasma, there are lots of things on my machine. I got Netflix/Brave running on Cinnamon, then had too many other issues. The instructions I found suggested `pkg install x11/plasma5-plasma`.

Have also tried sddm-kcm for gui setup. But here I see it is "ABANDONED". https://github.com/orgs/sddm/repositories

Maybe I got it from here https://community.kde.org/FreeBSD/Setup/Ports.

This handbook page Google found has lots of issues but I don't think I used it to start with.
https://people.freebsd.org/~blackend/doc/handbook/x11-wm.html

Maybe the Brave issue after installing plasma5 was to do with application launchers or paths for different users.

I suspect the serious X problems to be with HP bios and my Z2 mini having both Intel and Nvidia T1000 though FreeBSD only has Nvidia driver installed. Often, machine gets left with in different graphics mode after crashing (maybe scaled 640x480) and stays in this and boots to blank dead screen until another hard boot. Turning off bios fastboot maybe helping now.


----------



## Bluey (Apr 15, 2022)

Lots of errors in system log. Some earlier ones mentioned zygote, so 
`"$HERE/brave" --no-sandbox --no-zygote --test-type --v=0 "$@" || true`

Still getting lots of log errors. Brave/Netflix still working fine.

```
16 Apr 2022 05:55:46    hpz2freebsd    kernel    linux: jid 0 pid 64078 (ThreadPoolForeg): unsupported TCP socket option TCP_INFO (11)
```


```
56265    0.0  0.0     13596    3024  -  I    05:53       0:00.02 |           | `-- /bin/sh /usr/local/bin/linux-brave

59264    0.0  0.0      5632    3680  -  I    05:53       0:00.00 |           |   `-- /compat/ubuntu/bin/bash /compat/ubuntu/
61751    0.1  1.1  17336028  373080  -  S    05:53       0:04.26 |           |     |-- /opt/brave.com/brave/brave --no-sandb
66072    0.1  1.2  25787868  393140  -  SN   05:53       0:08.99 |           |     | |-- /compat/ubuntu/opt/brave.com/brave/
64078    0.0  0.7  17133812  232576  -  S    05:53       0:01.43 |           |     | |-- /compat/ubuntu/opt/brave.com/brave/
64179 0.0 0.7 17100568 228752 - S 05:53 0:00.06 | | | |-- /compat/ubuntu/opt/brave.com/brave/
```


----------



## AlephNull (May 5, 2022)

I've tried using this process to run Chrome (adapting the 2 wrapper scripts to start /opt/google/chrome/chrome) and it consistently crashes:


> Cannot chroot into /proc/ directory: No such file or directory
> [0505/201302.369129:ERROR:setuid_sandbox_client.cc(118)] Failed to read from chroot pipe: Success (0)
> [41050:41050:0505/201302.369537:ERROR:nacl_fork_delegate_linux.cc(311)] Bad NaCl helper startup ack (0 bytes)
> Cannot chroot into /proc/ directory: No such file or directory
> ...


Looking in /var/log/messages, I see a variety of error messages:


> May  5 20:12:51 host kernel: linux: jid 0 pid 41028 (chrome): syscall seccomp not implemented
> May  5 20:12:51 host kernel: pid 41031 (nacl_helper), jid 0, uid 204: exited on signal 5
> May  5 20:12:51 host kernel: pid 41028 (chrome), jid 0, uid 204: exited on signal 5
> May  5 20:12:51 host kernel: linux: jid 0 pid 41022 (chrome_crashpad_han): PTRAGE_GETREGSET NT_PRFPREG not implemented; returning EINVAL
> ...



I've checked and /compat/ubuntu/proc/ is definitely mounted and looks like a Linux procfs.  Does anyone have any suggestions to get it running?


----------



## shkhln (May 5, 2022)

AlephNull said:


> …


I counted 4 instances of the word "sandbox" and 2 mentions of "seccomp".


----------



## Bluey (May 7, 2022)

Found recommendation to use metaport.

https://community.kde.org/FreeBSD/Setup/Ports


----------



## AlephNull (May 8, 2022)

I've tried using various combinations of --no-sandbox --no-zygote --test-type but they all either crash on startup or refuse to allow me to login.


----------



## Nick-6 (May 8, 2022)

I've the following error logs while booting. How can I fix that?



```
compat.linux.emul_path: /compat/linux -> /compat/ubuntu
stat: /compat/ubuntu/ome: stat: No such file or directory
stat: /compat/ubuntu/ome/..: stat: No such file or directory
stat: /compat/ubuntu/ome: stat: No such file or directory
stat: /compat/ubuntu/ome/..: stat: No such file or directory
```


----------



## lucenera (May 8, 2022)

I used it to install Chrome. Everything is really perfect. Thank you all so much.


----------



## shkhln (May 9, 2022)

AlephNull said:


> I've tried using various combinations of --no-sandbox --no-zygote --test-type but they all either crash on startup or refuse to allow me to login.


This should be a separate thread.


----------



## grahamperrin@ (May 12, 2022)

Bluey said:


> Found recommendation to use metaport.
> 
> https://community.kde.org/FreeBSD/Setup/Ports



Which one?

There should be no problem with x11/kde5.


----------



## Bluey (May 13, 2022)

grahamperrin said:


> Which one?
> 
> There should be no problem with x11/kde5.


Started with x11/plasma5-plasma but now have the fat one you suggest but has lots of applications.


----------



## grahamperrin@ (May 13, 2022)

Bluey said:


> Started with x11/plasma5-plasma …



Thanks again. 

I can't imagine installation of Plasma Desktop (alone) leading to problems with Brave in Linuxulator. 



Bluey said:


> [This stuff maybe better in another thread.] … Maybe the Brave issue after installing plasma5 was to do with application launchers or paths for different users. …



 If anyone can reproduce symptoms: let's start a new topic, or chat in a desktop channel.


----------



## rusty (May 19, 2022)

AlephNull said:


> I've tried using this process to run Chrome (adapting the 2 wrapper scripts to start /opt/google/chrome/chrome) and it consistently crashes:
> 
> Looking in /var/log/messages, I see a variety of error messages:
> 
> ...


I recently installed GhostBSD 13.1-STABLE and followed this guide to install Brave. I couldn't get Brave to run, it was crashing as well.
I then used this script and it worked fine. Might be worth giving it a go.


----------



## Bluey (May 21, 2022)

rusty said:


> I recently installed GhostBSD 13.1-STABLE and followed this guide to install Brave. I couldn't get Brave to run, it was crashing as well.
> I then used this script and it worked fine. Might be worth giving it a go.


The script description says it is based on OP.


----------



## Bluey (May 21, 2022)

patovm04 said:


> **Notice:* Accessing your google account won't work. It will display something like this:
> _"Couldn't sign you in This browser or app may not be secure. Try using a different browser. If you’re already using a supported browser, you can refresh your screen and try again to sign in."_
> 
> To fix this, change your user agent to a non-chromium web browser, like Firefox for instance, and login to Gmail or any other google service (making sure to keep logged in). After this you can change your user agent back to default.
> ...





> Couldn’t sign you in​This browser or app may not be secure. Learn more
> Try using a different browser. If you’re already using a supported browser, you can try again to sign in.



Presently 2 issues with DRM content on https://iview.abc.net.au/:
1. Accessing Google account not working even if using the User-Agent Switcher and Manager. 

Default agent


> user-agent according to ua-parser-js v0.7.19​Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36



Tried multiple versions of agents. Doesn't seem to make a difference if 2FA is enabled or not for account. Need more clues....

2. After logging in with a non-google account, DRM content streaming fails but ABC local (presume non-DRM) content is ok.



> Video Player Error​Sorry, there has been a technical error with this video stream. For tips and troubleshooting please check our technical support page .
> 
> Error Code: 203000
> 
> ...



The error code description is a bit vague.


----------



## lucenera (May 22, 2022)

Bluey said:


> The script description says it is based on OP.


But the guide for version 13.0 says it took its cue from the script on GitHub (exchange of favors). I can confirm that on 13.1 the script works for me, but not the guide.

EDIT: Actually this guide still works on 13.1, it was me doing something wrong. It works even better than the script because with this guide, I can log into my Google account.


----------



## patovm04 (May 23, 2022)

Bluey said:


> Presently 2 issues with DRM content on https://iview.abc.net.au/:
> 1. Accessing Google account not working even if using the User-Agent Switcher and Manager.
> 
> Default agent
> ...


You can try changing your user agent without the need of any extension by appending `--user-agent="Mozilla/5.0 (X11; FreeBSD amd64; Linux x86_64)"` to your Brave / Chrome wrapper. Something like this:
`/usr/local/bin/linux-brave --user-agent="Mozilla/5.0 (X11; FreeBSD amd64; Linux x86_64)"`
After login in for the first time, you won't need to use that workaround anymore. (Otherwise many websites look terribly outdated or kinda broken).


----------



## Bluey (May 23, 2022)

lucenera said:


> s). I can confirm that on 13.1 the script works for me, but not the guide.


I used the guide 13.1-BETA3 iirc and upgraded now 13.1-RELEASE. Worked for me and still working. (I did choose to not make special temp fs.)


----------



## Bluey (May 24, 2022)

patovm04 said:


> You can try changing your user agent without the need of any extension by appending `--user-agent="Mozilla/5.0 (X11; FreeBSD amd64; Linux x86_64)"` to your Brave / Chrome wrapper. Something like this:
> `/usr/local/bin/linux-brave --user-agent="Mozilla/5.0 (X11; FreeBSD amd64; Linux x86_64)"`
> After login in for the first time, you won't need to use that workaround anymore. (Otherwise many websites look terribly outdated or kinda broken).


So that worked. Brave wrapper  looks like this.


```
# vi /compat/ubuntu/opt/brave.com/brave/brave-wrapper
.....
# Original
# "$HERE/brave" --no-sandbox --test-type --v=0 "$@" || true
# https://forums.freebsd.org/threads/linuxulator-how-to-install-brave-linux-app-on-freebsd-13-0.78879/post-533098
#  "$HERE/brave"  --no-sandbox --no-zygote --test-type --v=0 "$@" || true
 "$HERE/brave" --user-agent="Mozilla/5.0 (X11; FreeBSD amd64; Linux x86_64)" --no-sandbox --no-zygote --test-type --v=0 "$@" || true
```

ABC iview technical support replied on error 203000:

```
The ABC and its suppliers, authorised platform providers and content partners may embed digital rights management security in ABC iview or certain ABC Content and/or use other technical content protection measures as required to protect ABC Content from unauthorised access, and in order to meet obligations to third parties who own rights in ABC Content.

Please note, ABC iview is supported only with Google Chrome and Firefox browsers when using Linux.
 
Here are some things you can try to troubleshoot the issues:
1. Make sure you have the latest version of your internet browser installed.
2. Ensure that your browser's Digital Rights Management (DRM) settings are set to allow or enable.
3. Reduce the restrictive cookie settings, i.e. enable Allow Cookies and ensure browser add-ons or plugins such as ad blockers are allowing ABC iview to come through.
4. Switch off your internet modem/router for 30 seconds then switch everything on again.
5. Clear your web browser cache and delete temporary files.
```
There were no issues or changes made to 1,2,3. I ignored 4. Just had to delete the web site temporary files. Still took several attempts but the error flushed itself out and DRM video now plays in iview. I suggested they need to fix the bad code in iview.

PS works a bit better always clearing cookies on window close. Brave>Settings>Cookies...>Always clear cookies when windows are closed>[Add "abc.net.au" including third party cookies]. Still generates the error 203000 but second attempt to view seems to work.


----------



## lucenera (Jun 2, 2022)

patovm04 said:


> # Set correct timezone inside your chroot:
> `printf "%b\n" "0.0 0 0.0\n0\nUTC" > /etc/adjtime`
> `sudo dpkg-reconfigure tzdata` # For some reason sudo is necessary here, otherwise it fails.


Between the two, I would add this:

```
dpkg-reconfigure locales
```
And I would delete the sudo because the only thing to fail is the missing language configuration, which precisely happens with the command to be added.


----------



## Nick-6 (Jun 4, 2022)

After upgrading to FreeBSD 13.1-RELEASE amd64, `linux-brave` stopped working with the following error message.


```
% linux-brave
No matching processes belonging to you were found
W: [(null)] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
ELF interpreter /lib64/ld-linux-x86-64.so.2 not found, error 2
Abort trap
```


----------



## lucenera (Jun 6, 2022)

patovm04 Is there any way to add fonts to the browser? I've added a .fonts folder, with all the Google fonts in it, to the jail root home, but Chrome still fails to display some fonts correctly.​


----------



## Holger (Jun 10, 2022)

Got Google Chrome working on FreeBSD-13.1-RELEASE.

It had worked as described by OP on FreeBSD-13.0-RELEASE, but stopped working after the OS-upgrade. The symptom was Chrome opening an empty window and displaying nothing.

I gathered up some information spread across this forum. Here is the resulting invocation of Chrome in the `chrome-wrapper` script (aka `brave-wrapper`):

```
...

export LIBGL_DRI3_DISABLE=1

"$HERE/chrome" --in-process-gpu --no-sandbox --no-zygote --test-type --enable-features=UseOzonePlatform --ozone-platform=x11 --v=0 "$@" || true
```
The Ozone- and Zygote-related switches are essential, as is the LIBGL_* variable!


----------



## scottro (Jun 11, 2022)

I had trouble making it work on 13.1. However, followed Holger's instructions and replaced the $HERE/chrome with $HERE/brave (obvious, you would think, until you forget to do so<sigh>). I then had to restart the ubuntu service again, and try a  couple of times, but in the end, it worked perfectly. I did need the line (not sure exactly which parts were needed, I just wanted it to work so didn't test), that Holger supplied but aside from that, the original tutorial worked.


----------



## Bluey (Jun 13, 2022)

Another streaming service binge.com.au fails on Linux multiple browsers with error:

```
InvalidStateError: Failed to execute 'update' on 'MediaKeySession': Rejected with system code (72)
```

Problem and fix are discussed here:








						Binge.com.au video streams not working on Ubuntu 20.04
					

I am running Ubuntu 20.04 and have subscribed to the new Binge.com.au video streaming service offered by Foxtel.   When trying to stream via Ubuntu, it freezes at 20% buffer. I have tried multiple




					askubuntu.com
				



https://github.com/masterneko/binge-on-linux


			https://github.com/caelwithcats/binge-on-linux/raw/master/chrome.crx
		


Installed the chrome.crx file in Brave>Extensions and works now!


----------



## petru garstea (Jul 8, 2022)

Greetings,
Has anyone tried https://play.geforcenow.com/ ? Chrome crashes after a few seconds when I visit the site.

The same story is happening with gfn-electron wrapper https://github.com/hmlendea/gfn-electron

Cheers


----------



## First_Law_of_Unix (Aug 15, 2022)

Thanks


patovm04 said:


> *Important notes:*
> 1) This guide is for FreeBSD 13.0 and newer only!!



Thank You for this excellent detailed guide, brave worked on a fresh install of FreeBSD 13.1.

How can I install Chrome signing key?


----------



## helionsantos (Aug 18, 2022)

For those who are getting the "Failed to connect to the bus" error, when editing the wrapper script, use the flag --disable-gpu


----------



## i3luefire (Sep 30, 2022)

i am getting an error about security when trying to install brave in the chroot


```
root@my-ghostbsd-pc:/# apt update ; apt install -y brave-browser
Get:1 http://dl.google.com/linux/chrome/deb stable InRelease [1811 B]
Ign:2 https://repo.vivaldi.com/archive/deb stable InRelease                                             
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease                 
Err:1 http://dl.google.com/linux/chrome/deb stable InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4EB27DB2A3B88B8B
Err:4 https://repo.vivaldi.com/archive/deb stable Release
  Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate.  Could not handshake: Error in the certificate verification. [IP: 151.101.65.91 443]
Reading package lists... Done                     
W: GPG error: http://dl.google.com/linux/chrome/deb stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4EB27DB2A3B88B8B
E: The repository 'http://dl.google.com/linux/chrome/deb stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://repo.vivaldi.com/archive/deb stable Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package brave-browser
```


----------



## Bluey (Oct 25, 2022)

petru garstea said:


> Greetings,
> Has anyone tried https://play.geforcenow.com/ ? Chrome crashes after a few seconds when I visit the site.
> 
> The same story is happening with gfn-electron wrapper https://github.com/hmlendea/gfn-electron
> ...


Haven't tried before, but yes. Crashes Brave - renders home page then crashes - nasty. 

Everything else works, except Amazon Prime won't do HD as on all Linux. (No issues on Windows 10 on same hardware.) Some suggest installing some wine components permits HD to play on Linux. Anyone know how to do this with Brave/Linuxulator?


----------



## LordInateur (Nov 6, 2022)

ashleymills said:


> Thanks for your efforts on this. Everything works fine, netflix etc fantastic. However I have one issue. I have a titan key setup with my google account so when I try and login to google it tries to probe udev, which causes a segfault:
> 
> 
> ```
> ...



I would be interested to know if you or someone else has solved this particular issue. Brave tends to crash on my end as well any time it needs a hardware token.


----------

