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

Rand0m

Member

Reaction score: 8
Messages: 67

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.
 
OP
P

patovm04

Member

Reaction score: 70
Messages: 65

BawdyAnarchist

Member

Reaction score: 17
Messages: 97

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:

Code:
[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
Code:
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.
 

Rand0m

Member

Reaction score: 8
Messages: 67

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:

Code:
[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
Code:
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.
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

Member

Reaction score: 17
Messages: 97

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
Code:
#  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:
Code:
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.
 
Last edited:

Rand0m

Member

Reaction score: 8
Messages: 67

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
Code:
#  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:
Code:
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.
Thanks so much, I will give it a try this weekend.
 

Oleg_NYC

Member

Reaction score: 5
Messages: 85

When I type
linux-brave &
, the browser doesn't launch and I get this output:
Code:
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

Member

Reaction score: 5
Messages: 85

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

Member

Reaction score: 5
Messages: 85

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:
Code:
 --enable-features=UseOzonePlatform --ozone-platform=wayland
, brave will load in the pure wayland environment.
 

priyadarshan

Active Member

Reaction score: 42
Messages: 132

[...]

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

Member

Reaction score: 5
Messages: 85

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

Member

Reaction score: 16
Messages: 27

Just did the tutorial on a fresh install and got the following:
Code:
/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?
 
Top