# [Linuxulator] How to run Google Chrome (linux-binary) on FreeBSD



## patovm04 (Nov 2, 2020)

*[Update]*_ For new instructions targeting FreeBSD 13.0 and newer, please see:_
_https://forums.freebsd.org/threads/linuxulator-how-to-install-brave-linux-app-on-freebsd-13-0.78879/_


*Important notes: *
1) Tested upon FreeBSD 12.2-RELEASE. Used Ubuntu-based linux compat instead of default CentOS one.
2) Sound, webcam, microphone, hardware acceleration all properly work. Widevine support too (Netflix, Spotify, Amazon Prime Video, HBO Max, etc).
3) The /home and /tmp directories will be shared between FreeBSD and Linux apps.
4) To successfully run Google Chrome, we rely on games/linux-steam-utils workarounds.
5) Due to all sorts of problems encountered while using /compat/ubuntu as the chroot location, I've opted to use /compat/linux instead, although it's discouraged as 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.
6) I recommend (although is not a requirement as far as I know) to use a tmpfs /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 entry to /etc/fstab to use tmpfs for /tmp:
`printf "tmpfs\t/tmp\ttmpfs\trw,mode=1777\t0\t0\n" >> /etc/fstab`
# Reboot back to normal multi-user mode.


*Let's begin:*
`su`
# Enable linux compatibility layer:
`sysrc linux_enable=YES`

# Start linux service:
`service linux start`

# Install needed packages:
`pkg install linux-steam-utils debootstrap pulseaudio`

# Copy the useful files to a temporary folder:
`cp -R /usr/local/steam-utils /usr/local/steam-utils-bak`

# Uninstall linux-steam-utils and all its dependencies:
`pkg delete linux-steam-utils && pkg autoremove`

# Move back /usr/local/steam-utils-bak to the correct location:
`mv /usr/local/steam-utils-bak/ /usr/local/steam-utils`

# Just to be sure to start clean:
`rm -Rf /compat/linux`

# Create necessary mount points for a working linuxulator:
`mkdir -p /compat/linux/dev/fd && mkdir /compat/linux/dev/shm && mkdir /compat/linux/proc && mkdir /compat/linux/sys && mkdir /compat/linux/home && mkdir /compat/linux/tmp`

# Make sure your /etc/fstab looks like this:

```
tmpfs                   /tmp            tmpfs           rw,mode=1777            0       0
procfs                  /proc           procfs          rw,late                 0       0
fdescfs                 /dev/fd         fdescfs         rw,late                 0       0
linprocfs       /compat/linux/proc      linprocfs       rw,late                 0       0
linsysfs        /compat/linux/sys       linsysfs        rw,late                 0       0
devfs           /compat/linux/dev       devfs           rw,late                 0       0
fdescfs         /compat/linux/dev/fd    fdescfs         rw,late,linrdlnk        0       0
tmpfs           /compat/linux/dev/shm   tmpfs           rw,late,mode=1777       0       0
/home           /compat/linux/home      nullfs          rw,late                 0       0
/tmp            /compat/linux/tmp       nullfs          rw,late                 0       0
```

# Mount needed filesystems:
`mount -al`

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

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

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

# Add Chrome repository:
`printf "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /compat/linux/etc/apt/sources.list.d/google-chrome.list`

# Fetch Chrome signing key:
`fetch -o /compat/linux/ https://dl.google.com/linux/linux_signing_key.pub`

# Create custom Chrome launcher script and make it executable:
`touch /compat/linux/bin/chrome && chmod +x /compat/linux/bin/chrome`

# Edit it so it has this content:

```
#!/compat/linux/bin/bash

export CHROME_PATH="/opt/google/chrome/chrome"
export CHROME_WRAPPER="`readlink -f "$0"`"
export LD_LIBRARY_PATH=/usr/local/steam-utils/lib64/fakeudev
export LD_PRELOAD=/usr/local/steam-utils/lib64/webfix/webfix.so
export LIBGL_DRI3_DISABLE=1

exec -a "$0" "$CHROME_PATH" --no-sandbox --no-zygote --test-type --v=0 "$@"
```

# Fix broken symlink:
`cd /compat/linux/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`

# Set correct timezone inside your chroot:
`printf "%b\n" "0.0 0 0.0\n0\nUTC" > /compat/linux/etc/adjtime`

# Make sure everything is properly mounted:
`mount -al`

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

# Choose your timezone:
`dpkg-reconfigure tzdata`

# Install some required programs (except for ttf-mscorefonts-installer which is optional):
`apt update ; apt install -y gnupg pulseaudio fonts-symbola ttf-mscorefonts-installer`

# Install Google Chrome:
`apt-key add linux_signing_key.pub && apt update && apt install -y google-chrome-stable`

# Exit chroot
`exit`

# Exit su
`exit`

# Now create a .desktop file to launch Chrome as any other app:
`touch ~/.local/share/applications/google-chrome.desktop`

# Make it contain something like this:

```
[Desktop Entry]
Type=Application
Version=1.0
Encoding=UTF-8
Name=Google Chrome
Comment=Google web browser based on WebKit
Icon=google-chrome
Exec=/compat/linux/bin/chrome
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
```

**Note:* Syncing or accessing your google account won't work. It will display:
_"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 Firefox, for instance, and login to Gmail (keep it logged in). Then change your user agent back to default and turn on sync. User-Agent Switcher and Manager extension is what worked for me 


Also be aware that if you didn't have pulseaudio already installed on FreeBSD, a reboot may be required to get sound working within Google Chrome.

If you happen to still have sound issues, please see comment #43.


That's all!
Many thanks to Alex S. (shkhln) for his games/linux-steam-utils port, and Alexandru Hamedu (st1905) for helping in all sorts of things earlier when trying to set up a CentOS-based linuxulator.


*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

*EDIT 1:* Replaced `sudo` for `su` to fix some of the commands above.
*EDIT 2:* Reworded the point about using a tmpfs /tmp to make it clearer.
*EDIT 3:* Added a workaround to be able to log in to google accounts, and fix syncing.
*EDIT 4: *Added pulseaudio as a required package for both FreeBSD and the Ubuntu chroot. This should fix sound output in most of the cases.
*EDIT 5: *Added fonts-symbola to fix some missing characters.
*EDIT 6:* Rewrote Chrome launcher script to fix PWA (Progressive Web Apps).
*EDIT 7:* Added link to a fix by "mrclksr" that explains how to tell pulseaudio clients where to find sound.


----------



## patovm04 (Nov 2, 2020)

*[Update]*_ For new instructions targeting FreeBSD 13.0 and newer, please see:
https://forums.freebsd.org/threads/linuxulator-how-to-install-brave-linux-app-on-freebsd-13-0.78879/_


*Bonus: *This method should be valid for installing any other Chromium-based web browser (Opera, Vivaldi, Edge, etc).
For instance, after doing all of the above, installing Brave browser is as simple as doing the following:

`su`
# Chroot into your linux environment:
`chroot /compat/linux /bin/bash`

# Install some needed programs:
`apt install -y apt-transport-https curl`

# 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 launcher script and make it executable:
`touch /compat/linux/bin/brave && chmod +x /compat/linux/bin/brave`

# Edit it so it has this content:

```
#!/compat/linux/bin/bash

export BRAVE_PATH="/opt/brave.com/brave/brave"
export CHROME_WRAPPER="`readlink -f "$0"`"
export LD_LIBRARY_PATH=/usr/local/steam-utils/lib64/fakeudev
export LD_PRELOAD=/usr/local/steam-utils/lib64/webfix/webfix.so
export LIBGL_DRI3_DISABLE=1

exec -a "$0" "$BRAVE_PATH" --no-sandbox --no-zygote --test-type --v=0 "$@"
```

# Exit su:
`exit`

# Now create a .desktop file to launch Brave as any other app:
`touch ~/.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=/compat/linux/bin/brave
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
```

All done! And it runs as well as Google Chrome 

*EDIT 1:* Rewrote Brave launcher script to fix PWA (Progressive Web Apps).
*EDIT 2:* Actually fix PWA for Brave.


----------



## vermaden (Nov 2, 2020)

Does NETFLIX work there?


----------



## twschulz (Nov 2, 2020)

Hmm... I gave this a shot, but it seems I must have gone astray one place. Actually, the first time it asks me to make sure that /dev/shm is 1777 (of course this is /compat/linux/dev/shm). I did that and then get this message:


```
/compat/linux/bin/sh -x /compat/linux/bin/chrome
+ readlink -f /compat/linux/bin/chrome
+ SCRIPT=/compat/linux/bin/chrome
+ dirname /compat/linux/bin/chrome
+ readlink -f /compat/linux/bin/..
+ USR_DIRECTORY=/compat/linux
+ CHROME_PATH=/opt/google/chrome/chrome
+ export LD_LIBRARY_PATH=/usr/local/steam-utils/lib64/fakeudev
+ export LD_PRELOAD=/usr/local/steam-utils/lib64/webfix/webfix.so
+ export LIBGL_DRI3_DISABLE=1
+ /opt/google/chrome/chrome --no-sandbox --no-zygote --test-type --v=0
[36030:101686:1102/202353.943052:ERROR:file_path_watcher_linux.cc(315)] inotify_init() failed: Function not implemented (38)
Gtk-Message: 20:23:54.074: Failed to load module "colorreload-gtk-module"
Gtk-Message: 20:23:54.075: Failed to load module "appmenu-gtk-module"
[36030:101690:1102/202354.095410: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.
[36030:36030:1102/202354.095989:ERROR:proxy_config_service_linux.cc(607)] inotify_init failed: Function not implemented (38)
[36030:101686:1102/202354.101314:ERROR:address_tracker_linux.cc(195)] Could not create NETLINK socket: Address family not supported by protocol (97)
[36030:101687:1102/202354.104834:ERROR:platform_shared_memory_region_posix.cc(250)] Creating shared memory in /dev/shm/.com.google.Chrome.kbJFfB failed: Operation not supported (95)
[36030:101687:1102/202354.105280:ERROR:platform_shared_memory_region_posix.cc(250)] Creating shared memory in /dev/shm/.com.google.Chrome.YOHGEB failed: Operation not supported (95)
Aborted
```

 My mount seems to be correct as well:


```
linprocfs on /compat/linux/proc (linprocfs, local)
linsysfs on /compat/linux/sys (linsysfs, local)
tmpfs on /tmp (tmpfs, local)
tmpfs on /compat/linux/dev/shm (tmpfs, local)
procfs on /proc (procfs, local)
fdescfs on /compat/linux/dev/fd (fdescfs)
devfs on /compat/linux/dev (devfs, local, multilabel)
/usr/home on /compat/linux/home (nullfs, local)
/tmp on /compat/linux/tmp (nullfs, local)
```

FWIW, since my user has its own dataset, you also need to mount that with nullfs as well.

I'd love to hear where I may have gone wrong. It seems that I missed something.


----------



## patovm04 (Nov 2, 2020)

vermaden said:


> Does NETFLIX work there?


Yes it does, widevine gets installed the first time you need it


----------



## patovm04 (Nov 2, 2020)

twschulz said:


> Hmm... I gave this a shot, but it seems I must have gone astray one place. Actually, the first time it asks me to make sure that /dev/shm is 1777 (of course this is /compat/linux/dev/shm). I did that and then get this message:
> 
> 
> ```
> ...


Hmm you're missing the other fdescfs (the one mounted in /dev/fd).
I think you just need to modify your /etc/fstab (`sudo ee /etc/fstab`) and copy-paste this there:

```
tmpfs                   /tmp            tmpfs           rw,mode=1777            0       0
procfs                  /proc           procfs          rw,late                 0       0
fdescfs                 /dev/fd         fdescfs         rw,late                 0       0
linprocfs       /compat/linux/proc      linprocfs       rw,late                 0       0
linsysfs        /compat/linux/sys       linsysfs        rw,late                 0       0
devfs           /compat/linux/dev       devfs           rw,late                 0       0
fdescfs         /compat/linux/dev/fd    fdescfs         rw,late,linrdlnk        0       0
tmpfs           /compat/linux/dev/shm   tmpfs           rw,late,mode=1777       0       0
/home           /compat/linux/home      nullfs          rw,late                 0       0
/tmp            /compat/linux/tmp       nullfs          rw,late                 0       0
```
Then do `sudo mount -al` and try again


----------



## lme@ (Nov 3, 2020)

Having widevine support would be fantastic!
I tried your tutorial but Chrome only shows an white window, Brave browser acts the same. If I start it from a terminal I see this:


```
NomadBSD:/home/lars% /compat/linux/bin/chrome 
[15192:101657:1103/220956.205343:ERROR:file_path_watcher_linux.cc(315)] inotify_init() failed: Function not implemented (38)
[15192:101662:1103/220956.534722: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.
[15192:101657:1103/220956.539591:ERROR:address_tracker_linux.cc(195)] Could not create NETLINK socket: Address family not supported by protocol (97)
[15192:101658:1103/220956.543718:ERROR:udev_watcher.cc(51)] Failed to initialize a udev monitor.
[15192:101671:1103/220956.624886: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.
[15192:101671:1103/220956.625928: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.
[15192:101671:1103/220956.670035: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.
[15192:101671:1103/220956.671282: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.
[15194:101675:1103/220956.678367:ERROR:file_path_watcher_linux.cc(315)] inotify_init() failed: Function not implemented (38)
[15194:101677:1103/220956.678383:ERROR:address_tracker_linux.cc(195)] Could not create NETLINK socket: Address family not supported by protocol (97)
[15192:101681:1103/220957.115639: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.
[15192:101681:1103/220957.116773: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.
[15192:101681:1103/220957.117296: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.
[15192:101681:1103/220957.117944: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.
[15192:101681:1103/220957.118422: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.
[15194:101675:1103/220957.119997:ERROR:address_tracker_linux.cc(195)] Could not create NETLINK socket: Address family not supported by protocol (97)
[15194:101675:1103/221005.057441:ERROR:address_tracker_linux.cc(195)] Could not create NETLINK socket: Address family not supported by protocol (97)

# freebsd-version -uk
12.2-RELEASE
12.2-RELEASE

# df -h
Filesystem                   Size    Used   Avail Capacity  Mounted on
zroot/ROOT/nomadbsd-1.3.1    856G    9.2G    846G     1%    /
devfs                        1.0K    1.0K      0B   100%    /dev
[...]
procfs                       4.0K    4.0K      0B   100%    /proc
tmpfs                         19G     21M     19G     0%    /tmp
linprocfs                    4.0K    4.0K      0B   100%    /compat/linux/proc
linsysfs                     4.0K    4.0K      0B   100%    /compat/linux/sys
devfs                        1.0K    1.0K      0B   100%    /compat/linux/dev
fdescfs                      1.0K    1.0K      0B   100%    /compat/linux/dev/fd
tmpfs                         19G    4.0K     19G     0%    /compat/linux/dev/shm
/usr/home                    869G     23G    846G     3%    /compat/linux/home
/tmp                          19G     21M     19G     0%    /compat/linux/tmp

# kldstat

kldstat 
Id Refs Address                Size Name
 1  109 0xffffffff80200000  227ad00 kernel
 2    1 0xffffffff8247b000   3bad38 zfs.ko
 3    2 0xffffffff82836000     a448 opensolaris.ko
 4    1 0xffffffff82841000     71a8 ums.ko
 5    1 0xffffffff832fa000     4df4 cuse.ko
 6    1 0xffffffff832ff000     31c8 acpi_ibm.ko
 7    1 0xffffffff83303000   12bd6c i915kms.ko
 8    1 0xffffffff8342f000    75c50 drm.ko
 9    4 0xffffffff834a5000    12d30 linuxkpi.ko
10    3 0xffffffff834b8000    13f30 linuxkpi_gplv2.ko
11    2 0xffffffff834cc000      6d0 debugfs.ko
12    1 0xffffffff834cd000     245d i915_skl_dmc_ver1_27_bin.ko
13    1 0xffffffff834d0000      ac0 sysctlbyname_improved.ko
14    1 0xffffffff834d1000    16bf0 if_iwm.ko
15    1 0xffffffff834e8000   205e11 iwm8000Cfw.ko
16    1 0xffffffff836ee000     4260 ng_ubt.ko
17    3 0xffffffff836f3000     9bd0 netgraph.ko
18    2 0xffffffff836fd000     9128 ng_hci.ko
19    1 0xffffffff83707000      9b0 ng_bluetooth.ko
20    1 0xffffffff83708000     1000 cpuctl.ko
21    1 0xffffffff83709000    3c490 linux.ko
22    4 0xffffffff83746000     4b80 linux_common.ko
23    1 0xffffffff8374b000    35cb0 linux64.ko
24    1 0xffffffff83781000      4f9 pty.ko
25    1 0xffffffff83782000     54f8 linprocfs.ko
26    1 0xffffffff83788000     1f3c linsysfs.ko
27    1 0xffffffff8378a000     1a20 fdescfs.ko
28    1 0xffffffff8378c000     87d0 tmpfs.ko
29    1 0xffffffff83795000     2940 nullfs.ko
30    1 0xffffffff83798000      acf mac_ntpd.ko
31    1 0xffffffff83799000    18f28 ext2fs.ko
32    1 0xffffffff837b2000    103f0 fusefs.ko
33    1 0xffffffff837c3000     3d64 geom_linux_lvm.ko
34    1 0xffffffff837c7000     20c0 acpi_wmi.ko
35    1 0xffffffff837ca000     2a80 acpi_video.ko
```

Do you have an idea what I could do?


----------



## shkhln (Nov 3, 2020)

lme@ said:


> ```
> [15192:101658:1103/220956.543718:ERROR:udev_watcher.cc(51)] Failed to initialize a udev monitor.
> ```





lme@ said:


> Do you have an idea what I could do?


Don't forget fakeudev.


----------



## lme@ (Nov 3, 2020)

shkhln said:


> Don't forget fakeudev.


I do have the fakeudev export in the chrome start script. And the lib is also there:

```
# ls /usr/local/steam-utils/lib64/fakeudev/
libudev.so.0
```

BTW: /var/log/messages shows:


```
Nov  3 23:09:50 NomadBSD kernel: linux: pid 16763 (Chrome_IOThread): syscall inotify_init not implemented
Nov  3 23:09:50 NomadBSD kernel: linux: pid 16763 (VideoCaptureThr): syscall name_to_handle_at not implemented
Nov  3 23:09:50 NomadBSD kernel: linux: pid 16763 (CacheThread_Blo): possibly incorrect MADV_DONTNEED
Nov  3 23:09:50 NomadBSD kernel: linux: pid 16763 (ThreadPoolSingl): ioctl fd=65, cmd=0xf50c ('�',12) is not implemented
Nov  3 23:09:50 NomadBSD kernel: linux: pid 16763 (ThreadPoolSingl): ioctl fd=66, cmd=0xf50c ('�',12) is not implemented
Nov  3 23:09:50 NomadBSD kernel: linux: pid 16763 (ThreadPoolSingl): ioctl fd=70, cmd=0xf50c ('�',12) is not implemented
Nov  3 23:09:50 NomadBSD kernel: linux: pid 16763 (ThreadPoolSingl): ioctl fd=77, cmd=0xf50c ('�',12) is not implemented
Nov  3 23:09:50 NomadBSD kernel: linux: pid 16763 (ThreadPoolSingl): ioctl fd=76, cmd=0xf50c ('�',12) is not implemented
Nov  3 23:09:50 NomadBSD kernel: linux: pid 16763 (ThreadPoolSingl): ioctl fd=85, cmd=0xf50c ('�',12) is not implemented
Nov  3 23:09:50 NomadBSD kernel: linux: pid 16765 (ThreadPoolForeg): syscall inotify_init not implemented
Nov  3 23:09:50 NomadBSD kernel: linux: pid 16763 (ThreadPoolSingl): ioctl fd=53, cmd=0xf50c ('�',12) is not implemented
Nov  3 23:09:50 NomadBSD kernel: linux: pid 16764 (GpuWatchdog): syscall memfd_create not implemented
Nov  3 23:09:50 NomadBSD kernel: linux: pid 16765 (ThreadPoolForeg): ioctl fd=49, cmd=0xf50c ('�',12) is not implemented
Nov  3 23:09:50 NomadBSD kernel: linux: pid 16765 (ThreadPoolForeg): unsupported madvise behav -1
Nov  3 23:09:50 NomadBSD kernel: pid 16764 (GpuWatchdog), jid 0, uid 1001: exited on signal 5
Nov  3 23:09:51 NomadBSD kernel: linux: pid 16768 (GpuWatchdog): syscall memfd_create not implemented
Nov  3 23:09:51 NomadBSD kernel: pid 16768 (GpuWatchdog), jid 0, uid 1001: exited on signal 5
Nov  3 23:09:51 NomadBSD kernel: linux: pid 16765 (ThreadPoolForeg): ioctl fd=71, cmd=0xf50c ('�',12) is not implemented
Nov  3 23:09:51 NomadBSD kernel: linux: pid 16769 (GpuWatchdog): syscall memfd_create not implemented
Nov  3 23:09:51 NomadBSD kernel: pid 16769 (GpuWatchdog), jid 0, uid 1001: exited on signal 5
Nov  3 23:09:51 NomadBSD kernel: linux: pid 16763 (BatteryStatusNo): possibly incorrect MADV_DONTNEED
Nov  3 23:09:51 NomadBSD kernel: pid 16772 (GpuWatchdog), jid 0, uid 1001: exited on signal 5
Nov  3 23:09:51 NomadBSD kernel: linux: pid 16763 (BatteryStatusNo): possibly incorrect MADV_DONTNEED
Nov  3 23:09:51 NomadBSD syslogd: last message repeated 3 times
Nov  3 23:09:51 NomadBSD kernel: pid 16773 (GpuWatchdog), jid 0, uid 1001: exited on signal 5
Nov  3 23:09:51 NomadBSD kernel: pid 16775 (GpuWatchdog), jid 0, uid 1001: exited on signal 5
Nov  3 23:09:51 NomadBSD kernel: pid 16776 (GpuWatchdog), jid 0, uid 1001: exited on signal 5
Nov  3 23:09:51 NomadBSD kernel: pid 16777 (GpuWatchdog), jid 0, uid 1001: exited on signal 5
Nov  3 23:09:51 NomadBSD kernel: pid 16778 (GpuWatchdog), jid 0, uid 1001: exited on signal 5
Nov  3 23:09:51 NomadBSD kernel: pid 16763 (BatteryStatusNo), jid 0, uid 1001: exited on signal 5
```


----------



## patovm04 (Nov 3, 2020)

lme@ said:


> Having widevine support would be fantastic!
> I tried your tutorial but Chrome only shows an white window, Brave browser acts the same. If I start it from a terminal I see this:
> 
> 
> ...


Looks like you're missing this line in /etc/fstab:

```
fdescfs                 /dev/fd         fdescfs         rw,late                 0       0
```
Also make sure your /compat/linux/bin/chrome has this line:

```
export LIBGL_DRI3_DISABLE=1
```
It's mandatory for all this to work, because at the moment DRI3 isn't working under linuxulator.


----------



## shkhln (Nov 3, 2020)

lme@ said:


> I do have the fakeudev export in the chrome start script. And the lib is also there:
> 
> ```
> # ls /usr/local/steam-utils/lib64/fakeudev/
> ...


I'd rather see `procstat -v` output.



lme@ said:


> BTW: /var/log/messages shows:
> 
> 
> ```
> ...


https://github.com/shkhln/linuxulator-steam-utils/commit/aac04139e23c73f4da5abba5b0ac12c6bfd76832


----------



## patovm04 (Nov 3, 2020)

shkhln said:


> I'd rather see `procstat -v` output.
> 
> 
> https://github.com/shkhln/linuxulator-steam-utils/commit/aac04139e23c73f4da5abba5b0ac12c6bfd76832


Mine is working just fine without "--in-process-gpu"


----------



## shkhln (Nov 3, 2020)

patovm04 said:


> Mine is working just fine without "--in-process-gpu"


You aren't using NomadBSD in the first place. (There's something wrong with /compat/linux/dev/fd mounting settings there.)


----------



## patovm04 (Nov 3, 2020)

shkhln said:


> You aren't using NomadBSD in the first place. (There's something wrong with /compat/linux/dev/fd mounting settings there.)


Ok


----------



## lme@ (Nov 3, 2020)

Actually it's no longer NomadBSD after I upgraded from NomadBSD to FreeBSD 12.2-RELEASE.
But I can try with a stock FreeBSD installation tomorrow.


----------



## lme@ (Nov 3, 2020)

patovm04 said:


> Looks like you're missing this line in /etc/fstab:
> 
> ```
> fdescfs                 /dev/fd         fdescfs         rw,late                 0       0
> ...



That's it! I don't know why I missed the fdesc line for fstab in your first post. It's working like a charm now!


----------



## patovm04 (Nov 3, 2020)

lme@ said:


> That's it! I don't know why I missed the fdesc line for fstab in your first post. It's working like a charm now!


Cool!


----------



## twschulz (Nov 4, 2020)

Yes, that seemed to be the thing. I had added it to the fstab, but forgot to do the mount. Thank you, it's working now. Excellent. I'll have to see if the teams standalone app works with this recipe too. I can post that when/if it actually works.

Impressive work and double kudos for documenting it so well.

Just curious, but why does /tmp have to be tmpfs? Is it because it can be mounted mode=1777? It was the only thing that took some work to untangle (I had to boot into single user mode to be able to unmount it correctly).

Thank you again.


----------



## patovm04 (Nov 4, 2020)

twschulz said:


> Yes, that seemed to be the thing. I had added it to the fstab, but forgot to do the mount. Thank you, it's working now. Excellent. I'll have to see if the teams standalone app works with this recipe too. I can post that when/if it actually works.
> 
> Impressive work and double kudos for documenting it so well.
> 
> ...


Actually that was more of a recommendation than a requirement, as tmpfs provides better performance and doesn't cause troubles with some programs (like Firefox on Wayland AFAIK). I honestly can't say this hack wouldn't work without tmpfs on /tmp, as I have not tried it. Gonna reword that part of the tutorial to make it clear.
And don't forget to let us know if Teams work


----------



## scottro (Nov 5, 2020)

It sort of worked for me. I ran into two issues, but I may have mistyped something along the way. The first was trying to install ttf-mscorefonts-installer, I got no such package. Secondly, though chrome runs, I have no sound. For what it's worth, I use openbox with no icons, and ran it with /compat/linux/bin/chrome.  It does run Netflix videos but again, no sound. I'll have to give it another try.


----------



## lme@ (Nov 5, 2020)

I also had no sound when I first tried Chrome. The next day after a reboot I had sound. So maybe that's something you can try.


----------



## scottro (Nov 5, 2020)

I definitely had some typos--doing it again, and this time I have the msfont installer.  I copied and pasted this time.

But still no sound, even after a reboot.


----------



## patovm04 (Nov 5, 2020)

scottro said:


> I definitely had some typos--doing it again, and this time I have the msfont installer.  I copied and pasted this time.
> 
> But still no sound, even after a reboot.


Did you install pulseaudio on Ubuntu? I didn't have sound till I installed it.


----------



## phpdave11 (Nov 7, 2020)

patovm04 said:


> Did you install pulseaudio on Ubuntu? I didn't have sound till I installed it.


This works great, except sound doesn't work.  I'm able to play Netflix, but sound doesn't work on any site.  I tried installing pulseaudio in the ubuntu chroot, but it said it was already installed:

pulseaudio is already the newest version (1:13.99.1-1ubuntu3).

Sound works fine in regular chromium on FreeBSD 12.2.  Any idea why it doesn't work with the Ubuntu chroot?


----------



## twschulz (Nov 7, 2020)

I put my experience with Teams in a different Thread 77622 to avoid hijacking and to close my loop.


----------



## scottro (Nov 7, 2020)

In case it's of any use, I also installed mpv. If I play a video straight from mpv, as opposed to going through the web browser, sound is fine.

I wonder if this has something to do with what we use for window manager. Maybe some of the desktop environments have something extra that we don't know about that is missing in window managers like openbox or dwm.  (Just a guess, no intelligent knowledge behind that guess, save for anecdotal experience on Linux where something would only work for those using say, Gnome, as opposed to dwm.)


----------



## patovm04 (Nov 7, 2020)

phpdave11 said:


> This works great, except sound doesn't work.  I'm able to play Netflix, but sound doesn't work on any site.  I tried installing pulseaudio in the ubuntu chroot, but it said it was already installed:
> 
> pulseaudio is already the newest version (1:13.99.1-1ubuntu3).
> 
> Sound works fine in regular chromium on FreeBSD 12.2.  Any idea why it doesn't work with the Ubuntu chroot?


I think I discovered what the problem was!
You need to have pulseaudio installed both on FreeBSD and inside Ubuntu chroot. I didn't know it was necessary, but have just confirmed it. So just do this:
`sudo pkg install pulseaudio`
And reboot so it takes effect.
Another thing to add to my Guide above


----------



## patovm04 (Nov 7, 2020)

scottro said:


> In case it's of any use, I also installed mpv. If I play a video straight from mpv, as opposed to going through the web browser, sound is fine.
> 
> I wonder if this has something to do with what we use for window manager. Maybe some of the desktop environments have something extra that we don't know about that is missing in window managers like openbox or dwm.  (Just a guess, no intelligent knowledge behind that guess, save for anecdotal experience on Linux where something would only work for those using say, Gnome, as opposed to dwm.)


Try installing pulseaudio also on your FreeBSD system:
`sudo pkg install pulseaudio`
Then reboot and see if your sound works


----------



## scottro (Nov 7, 2020)

I tried that, but it doesn't seem to solve the problem.  (I should add that even though I'm not having success, it's still a good thing that some folks can now get Netflix working properly. Even for me, I'm running it, so the video portion works, thanks to you.


----------



## patovm04 (Nov 7, 2020)

scottro said:


> I tried that, but it doesn't seem to solve the problem.  (I should add that even though I'm not having success, it's still a good thing that some folks can now get Netflix working properly. Even for me, I'm running it, so the video portion works, thanks to you.


Hmm, it's a shame it didn't work for you. If it's of any help, I'm running KDE Plasma 5. Maybe your hypothesis about desktop environments is not wrong after all...


----------



## zgee (Nov 8, 2020)

Thanks for the howto!
I initially ran into the same problem as a few others reported, regarding having no sound.
This was when launching Brave and Chrome from a fresh FreeBSD 12.2 install with a minimal x11-wm/i3 setup, after following your steps.
I then tried installing x11/kde5 and without modifying any values in /usr/local/etc/pulse/default.pa I now have sound in both Brave and Chrome. Pretty cool!


----------



## patovm04 (Nov 8, 2020)

zgee said:


> Thanks for the howto!
> I initially ran into the same problem as a few others reported, regarding having no sound.
> This was when launching Brave and Chrome from a fresh FreeBSD 12.2 install with a minimal x11-wm/i3 setup, after following your steps.
> I then tried installing x11/kde5 and without modifying any values in /usr/local/etc/pulse/default.pa I now have sound in both Brave and Chrome. Pretty cool!


Nice! Thanks for sharing!


----------



## scottro (Nov 8, 2020)

Decided I would try that too.  Turned out to require 578 packages downloaded take 4 something gigs, 1 GB of download. Don't know if I'd try it on a machine that I was using for something else (though, to be realistic, on modern machines, it isn't such a big deal.

I didn't make any other changes, just installed kde5 but continued using openbox for X.  However, still no sound for me. First World Problem?


----------



## patovm04 (Nov 8, 2020)

scottro said:


> Decided I would try that too.  Turned out to require 578 packages downloaded take 4 something gigs, 1 GB of download. Don't know if I'd try it on a machine that I was using for something else (though, to be realistic, on modern machines, it isn't such a big deal.
> 
> I didn't make any other changes, just installed kde5 but continued using openbox for X.  However, still no sound for me. First World Problem?


But did you try it from a plasma 5 session instead of openbox?


----------



## scottro (Nov 9, 2020)

No, I just ran openbox.  But I just tried in plasma, having to install sddm first. , and still no luck.  This may be a Just Me(TM) problem, so don't spend time trying to fix it, but I thank you very much for your efforts so far.


----------



## patovm04 (Nov 9, 2020)

scottro said:


> No, I just ran openbox.  But I just tried in plasma, having to install sddm first. , and still no luck.  This may be a Just Me(TM) problem, so don't spend time trying to fix it, but I thank you very much for your efforts so far.


Hahaha ok


----------



## lme@ (Nov 9, 2020)

scottro said:


> No, I just ran openbox.  But I just tried in plasma, having to install sddm first. , and still no luck.  This may be a Just Me(TM) problem, so don't spend time trying to fix it, but I thank you very much for your efforts so far.


You can still watch silent films *runs away*


----------



## scottro (Nov 9, 2020)

Ok, that literally made me laugh out loud.


----------



## st1905 (Nov 12, 2020)

Try copying /usr/local/etc/asound.conf   to /compat/linux/etc/asound.conf

And run `speaker-test`


----------



## scottro (Nov 12, 2020)

Ahah, that seems to do it IF I use kde. So for me, I have to take the extra steps of running, (after booting into text mode) sudo service sddm onestart, then logging in to KDE, then running chrome or brave.  But I do get Netflix with sound.  Thank you!

EDIT.  I typed too soon. Upon a reboot, sound no longer worked. Tried rebooting a few times, but no luck.  
That's alright, though, it worked once, which means it may be a Just Me issue.  And it shows that it is possible.


----------



## shkhln (Nov 12, 2020)

Start the pulseaudio daemon yourself.


----------



## scottro (Nov 12, 2020)

Nope, unfortunately, that didn't do it.


----------



## mrclksr (Nov 13, 2020)

scottro :
I had the same problem. The solution is basically to tell pulseaudio clients where to find sound by setting the socket path via the `PULSE_SERVER` environment variable.
Create a wrapper script under /usr/local/bin/chrome to start /compat/linux/bin/chrome:

```
#!/bin/sh

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
/compat/linux/bin/chrome
```


----------



## scottro (Nov 14, 2020)

By golly, that not only seems to have worked, but also to let me run it from openbox rather than using sddm to start kde to start chrome. Thank you!. 

Also, for those who like brave-browser, just change the last word of that script from chrome to brave and it works (with sound) in brave browser too.

Thanks again. And of course thanks to patovm04 who started the whole thing.

Next step, when I get around to it, is doing a fresh install without KDE and seeing if it will work with just openbox.  But, I don't know when I'll get to that. Regardless, I'm happy now.


----------



## scottro (Nov 14, 2020)

Ok, again thanks to patovm04 and mrclksr. (I find if I put the @ in front of a user name, it shows 
	
	



```
[USER] [/USER]
```
 tags so I've stopped using it till it gets fixed.  Anyway, I did a fresh install, this time, only installing openbox. I used mrclksr's script, and, even without all the KDE stuff, it worked. I had to restart each browser (brave and chrome) before sound worked, but I can now watch Netflix on FreeBSD, which, even though I barely use it (mostly my wife, who is Japanese, uses it to watch various Japanese and Korean dramas), it's good to know I can use it.


----------



## scottro (Nov 14, 2020)

I'm going to add, though this is obvious. (But I missed it till I gave it a bit of thought). If you use another language and are having font trouble in chrome or brave, you have to install the fonts in Ubuntu, doing a chroot to /compat/linux. In my case, I just use my wife's profile and it's in Japanese, so even though I had necessary fonts installed in FreeBSD, I was still seeing squares in Netflix, where there should have been Japanese writing. So, I did a chroot to /compat/linux and ran 

```
apt-get install fonts-takao-mincho
```
which fixed the problem. So, if you use a language other than English, be sure to install the fonts in /compat/linux. Fonts installed in the host FreeBSD system don't seem to have an effect.


----------



## scottro (Nov 14, 2020)

This also allows one to watch Amazon Prime video, which you can't do in regular FreeBSD.


----------



## Beastie7 (Nov 14, 2020)

This is huge work. Thank you! More people should know about this.


----------



## mrclksr (Nov 14, 2020)

scottro said:


> I'm going to add, though this is obvious. (But I missed it till I gave it a bit of thought). If you use another language and are having font trouble in chrome or brave, you have to install the fonts in Ubuntu, doing a chroot to /compat/linux. In my case, I just use my wife's profile and it's in Japanese, so even though I had necessary fonts installed in FreeBSD, I was still seeing squares in Netflix, where there should have been Japanese writing. So, I did a chroot to /compat/linux and ran
> 
> ```
> apt-get install fonts-takao-mincho
> ...





You can symlink the fonts and icons installed under /usr/local/share/ to the jail to make them available to the applications running in it:


```
# ln -s /usr/local/share/icons/* /compat/linux/usr/share/icons/
# ln -s /usr/local/share/fonts/* /compat/linux/usr/share/fonts/
```


----------



## mrclksr (Nov 14, 2020)

Beastie7 said:


> This is huge work. Thank you! More people should know about this.


I agree. Thanks a lot, patovm04


----------



## scottro (Nov 14, 2020)

Thanks mrclksr, I'll try that next time. 

EDIT Just tried it.  It didn't work. Possibly because I'm just using openbox?  Anyway, the other fix to install the fonts in chroot was quick and easy, so I'll leave it where it's at. But thank you for the suggestion, a little delving and I'm sure I could get that working too.


----------



## mrclksr (Nov 14, 2020)

scottro said:


> Thanks mrclksr, I'll try that next time.
> 
> EDIT Just tried it.  It didn't work. Possibly because I'm just using openbox?  Anyway, the other fix to install the fonts in chroot was quick and easy, so I'll leave it where it's at. But thank you for the suggestion, a little delving and I'm sure I could get that working too.


The symlinks for fonts in /usr/local/share/fonts aren't even necessary. Just make sure there is no /compat/linux/usr/local/share/fonts directory. It seems, If a Linux program from /compat/linux (without `chroot`'ing) tries to access a file, let's say /var/tmp/foo, the linuxulator first tries to resolve it to /compat/linux/var/tmp/foo if the file exists, otherwise it resolves to /var/tmp/foo.


----------



## scottro (Nov 14, 2020)

That didn't seem to be the case for me. Without the /compat/linux/usr/local/share/fonts, it still didn't show proper fonts. But this seems like nitpicking on my part as it's easily worked around and your script solved my real problem, that of no sound.


----------



## mrclksr (Nov 14, 2020)

scottro said:


> That didn't seem to be the case for me. Without the /compat/linux/usr/local/share/fonts, it still didn't show proper fonts. But this seems like nitpicking on my part as it's easily worked around and your script solved my real problem, that of no sound.


It might be necessary to run `fc-cache -r` as user. If that doesn't help either, we leave it at that


----------



## scottro (Nov 14, 2020)

No, that didn't do it either. But again, I thank you for the suggestions. I'm fine leaving it where it's at.


----------



## patovm04 (Nov 15, 2020)

Beastie7 said:


> This is huge work. Thank you! More people should know about this.


Thanks!


----------



## patovm04 (Nov 15, 2020)

mrclksr said:


> I agree. Thanks a lot, patovm04


No problem, and thank you for your pulseaudio fix!


----------



## scottro (Nov 15, 2020)

I've already given my thanks, to both of you, but just want add to those saying it is a big thing. I'm fortunate enough to be able to own more than one computer, but some people aren't, and the lack of Netflix and others might be a reason for them to choose something else. Now, someone with one computer has yet another thing properly working with FreeBSD, thanks to you folks. You should both be proud. You did a good thing.


----------



## neel (Nov 23, 2020)

I got Vivaldi running thanks to this! Thanks!

I also could get "Toontown Rewritten" working, provided you use this third-party launcher and don't use Nvidia graphics (my desktop has Nvidia whereas my laptop has Intel graphics). Some things don't get rendered, but still faster than Wine.


----------



## grahamperrin@ (Nov 28, 2020)

patovm04 said:


> …
> 5) Due to all sorts of problems encountered while using /compat/ubuntu as the chroot location, I've opted to use /compat/linux instead, although it's discouraged as 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.
> …



Re: LinuxJails - FreeBSD Wiki please, is there any future scope to use /compat/ubuntu instead?

Or have Chrome working with CentOS Linuxulator instead?

TIA


----------



## patovm04 (Nov 28, 2020)

grahamperrin said:


> Re: LinuxJails - FreeBSD Wiki please, is there any future scope to use /compat/ubuntu instead?
> 
> Or have Chrome working with CentOS Linuxulator instead?
> 
> TIA


Yes, Chrome can indeed work with CentOS linuxulator. The problem is I had issues and couldn't get my mic working there. Also the process to set it up was more tedious and slower. That's why I tried with Ubuntu then.
Anyway, here is a link to one of the sources I cited, where you can find the steps to run Chrome under a CentOS 7 linuxulator: https://pastebin.com/1W9Fh3e9
Good luck!


----------



## mrclksr (Nov 29, 2020)

grahamperrin said:


> Re: LinuxJails - FreeBSD Wiki please, is there any future scope to use /compat/ubuntu instead?
> 
> Or have Chrome working with CentOS Linuxulator instead?
> 
> TIA


I wrote a script based on patovm04 's howto, which installs Chrome or Brave into a Ubuntu jail under /compat/ubuntu.


----------



## shkhln (Nov 29, 2020)

Wait a minute… Where exactly are the jail bits? I only see chroot being used for setup and that's it.


----------



## mrclksr (Nov 29, 2020)

shkhln said:


> Wait a minute… Where exactly are the jail bits? I only see chroot being used for setup and that's it.


It has nothing to do with a FreeBSD jail; I just used the terminology from the wiki.


----------



## shkhln (Nov 29, 2020)

Presumably, the wiki only describes chroot because the jail usage is very similar. It does _not_ confuse these terms or use them interchangeably, note that it says (emphasis mine):


> This page describes the steps required to configure Ubuntu-based Linux jail or _chroot_


----------



## grahamperrin@ (Nov 30, 2020)

mrclksr said:


> … a wrapper script under /usr/local/bin/chrome to start /compat/linux/bin/chrome: …


A minor issue, using Open With with Firefox, configured as shown below:




– _Chromium_ no longer opens Chromium

– the new _Google Chrome_ tab window is not properly rendered and is not at the required address.

For example:


----------



## a6h (Nov 30, 2020)

File an issue at github.com/darktrojan/openwith


----------



## grahamperrin@ (Dec 2, 2020)

vigole said:


> File an issue with at github.com/darktrojan/openwith


Fixed in https://github.com/mrclksr/linux-browser-installer/issues/2


----------



## drewlander (Dec 3, 2020)

This worked great for me, thank you!!


----------



## monwarez (Jan 3, 2021)

Thanks for the guide, with 12.2-RELEASE I can get chrome working by using an alternate linux path (/compat/ubuntu) by using the following commands
`sysctl compat.linux.emul_path=/compat/ubuntu`


----------



## oleantus (Jan 20, 2021)

Thanks for this manual! I have successfully configured LinuxJail with Ubuntu.

Can anyone help me with the following problem? I have an Linux application that needs to interact with PCSC daemon. Currently I have installed and configured the pcscd directly in FreeBSD. And it works well. 
pcsc_scan utility sees my smartcard. And I can use smartcard when connecting to remote desktop using rdesktop.

Is there any possibility to allow the Linux application inside the LinuxJail to also have access to the configured pcscd?


----------



## delphinoob (Feb 8, 2021)

Would this be possible on netbsd?


----------



## shkhln (Feb 9, 2021)

delphinoob said:


> Would this be possible on netbsd?


No.


----------



## delphinoob (Feb 10, 2021)

shkhln said:


> No.


How come?


----------



## scottro (Feb 10, 2021)

So, I just tried this on 13-Beta1.  It works. A few notes. I just used openbox as my desktop, so I didn't need to create a .local/share/applications/whatever.desktop. What I *did* need to do was use mrclksr's script.  I just used brave, not chrome this time around. So, I made a script /usr/local/bin/brave which is the content of mrclksr's script a few posts above this, but instead of /bin/chrome it ends with /bin/brave. Once again, many thanks for your work with this (and mrclksr's script, too).


----------



## stratacast1 (Feb 11, 2021)

They sure weren't kidding about the high load with spotify lol. I'm amazed this works!


```
last pid: 31988;  load averages:  3.06,  2.33,  1.36                                   up 0+00:24:05  18:43:23
76 processes:  1 running, 75 sleeping
CPU:  4.1% user,  0.5% nice,  2.5% system,  0.0% interrupt, 92.9% idle
Mem: 3066M Active, 2460M Inact, 151M Laundry, 2923M Wired, 7094M Free
ARC: 1528M Total, 353M MFU, 1135M MRU, 1096K Anon, 8585K Header, 28M Other
     1331M Compressed, 2622M Uncompressed, 1.97:1 Ratio
Swap: 4096M Total, 4096M Free

  PID USERNAME    THR PRI NICE   SIZE    RES STATE    C   TIME    WCPU COMMAND
13280 stratacast     36  20    0  3153M   264M select   8  11:07 200.00% ThreadPoolForeg
13449 stratacast      5  20    0   911M   139M futex    6   5:32 100.00% ThreadPoolForeg
13528 stratacast     13  30   10  6086M   361M futex    7   0:16   0.29% ThreadPoolForeg
```


----------



## shkhln (Feb 11, 2021)

delphinoob said:


> How come?


Let me rephrase: it works on any BSD as long it's FreeBSD.


----------



## stratacast1 (Feb 11, 2021)

Who do we give information to about https://wiki.freebsd.org/LinuxApps? I want to comment on Spotify and Brave working in an Ubuntu 20.04 chroot


----------



## delphinoob (Feb 11, 2021)

shkhln said:


> Let me rephrase: it works on any BSD as long it's FreeBSD.


Okay. Obviously this specific guide would only work on freebsd but what i'm asking is if it's even in the realm of possibility that netbsd's linux binary emulation could be used for running the linux versions of chrome.
And if not I am simply curious as to why not


----------



## shkhln (Feb 12, 2021)

delphinoob said:


> what i'm asking is if it's even in the realm of possibility that netbsd's linux binary emulation could be used for running the linux versions of chrome.


You should ask _them_ about it.


----------



## linux->bsd (Feb 12, 2021)

mrclksr said:


> I wrote a script based on patovm04 's howto, which installs Chrome or Brave into a Ubuntu jail under /compat/ubuntu.


You're missing Ubuntu's security and update repos in your generated /etc/apt/sources.list. After adding them, an `apt upgrade` resulted in 184 package security updates being applied, including the following packages your script installs directly:


```
root@bionic:/# apt list --upgradable | grep -E 'gnupg|pulseaudio|\bapt|\bcurl'
apt/bionic-security 1.6.12ubuntu0.2 amd64 [upgradable from: 1.6.1]
apt-transport-https/bionic-security 1.6.12ubuntu0.2 all [upgradable from: 1.6.1]
apt-utils/bionic-security 1.6.12ubuntu0.2 amd64 [upgradable from: 1.6.1]
curl/bionic-security 7.58.0-2ubuntu3.12 amd64 [upgradable from: 7.58.0-2ubuntu3]
gnupg/bionic-security 2.2.4-1ubuntu1.3 amd64 [upgradable from: 2.2.4-1ubuntu1]
gnupg-l10n/bionic-security 2.2.4-1ubuntu1.3 all [upgradable from: 2.2.4-1ubuntu1]
gnupg-utils/bionic-security 2.2.4-1ubuntu1.3 amd64 [upgradable from: 2.2.4-1ubuntu1]
pulseaudio/bionic-security 1:11.1-1ubuntu7.11 amd64 [upgradable from: 1:11.1-1ubuntu7]
pulseaudio-utils/bionic-security 1:11.1-1ubuntu7.11 amd64 [upgradable from: 1:11.1-1ubuntu7]
```


```
root@bionic:/# apt-cache policy | grep 500
 500 http://download.opensuse.org/repositories/home:/stevenpusser/xUbuntu_18.04  Packages
 500 https://brave-browser-apt-release.s3.brave.com stable/main amd64 Packages
 500 http://archive.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages
 500 http://archive.ubuntu.com/ubuntu bionic-security/universe amd64 Packages
 500 http://archive.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages
 500 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages
 500 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages
 500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
 500 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages
 500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
```
Your script also works for installing the Pale Moon browser using Steve Pusser's Ubuntu steps. For sound support, my modifications create an additional /usr/local/bin/palemoon wrapper for exporting the audio/pulseaudio socket.

Additionally, I tested using your script to install Ubuntu 20.04, since Ubuntu 18.04 universe multiverse repos will hit EOL in April this year. It seems to be working fine there as well. You should consider updating the script to install 20.04 instead.


----------



## a6h (Feb 12, 2021)

delphinoob said:


> if it's even in the realm of possibility that netbsd's linux binary emulation could be used for running the linux versions of chrome.


Almost certainly not. N.B. I don't have a GUI/NetBSD installation, only CLI. It's N/A!
But if you have one, please test it and share your experience/result at netbsd-users mailing list.
Suppose it were possible to run Chromium: I'm not sure about HTML5/Sound.

More info at NetBSD:


			NetBSD Binary Emulation
		



			Chapter 31. Linux emulation
		

https://man.netbsd.org/compat_linux.8/


----------



## urmia (Feb 27, 2021)

I have a problem running Chrome and Brave. But before that I have a question about the starting steps. By doing 'service linux start' when linux is not installed it gives error that you don't have linux files, which by running 'pkg install emulators/linux_base-c7' I solve that error. Then I was not be able to run 'rm -Rf /compat/linux' given that the operation not permitted. Do we need  'service linux start' as clean install, or I am missing something? I know that you mentioned we need to start clean!

Then, following steps, and getting error on not able to write the chrome key in /dev/null, after fixing that, I could finished all steps but getting these errors and applications wont't start:

Chrome


> $ /compat/linux/bin/chrome
> ERROR: ld.so: object '/usr/local/steam-utils/lib64/webfix/webfix.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
> [2249:100920:0227/004438.576817:ERROR:file_path_watcher_linux.cc(315)] inotify_init() failed: Function not implemented (38)
> [2249:100924:0227/004438.635112: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.
> ...



Brave


> $ /compat/linux/bin/brave
> ERROR: ld.so: object '/usr/local/steam-utils/lib64/webfix/webfix.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
> [2202:101609:0227/003010.476300:ERROR:file_path_watcher_linux.cc(315)] inotify_init() failed: Function not implemented (38)
> [2202:101613:0227/003010.541241: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.
> ...



/etc/fstab

```
tmpfs                   /tmp            tmpfs           rw,mode=1777            0       0
procfs                  /proc           procfs          rw,late                 0       0
fdescfs                 /dev/fd         fdescfs         rw,late                 0       0
linprocfs       /compat/linux/proc      linprocfs       rw,late                 0       0
linsysfs        /compat/linux/sys       linsysfs        rw,late                 0       0
devfs           /compat/linux/dev       devfs           rw,late                 0       0
fdescfs         /compat/linux/dev/fd    fdescfs         rw,late,linrdlnk        0       0
tmpfs           /compat/linux/dev/shm   tmpfs           rw,late,mode=1777       0       0
/home           /compat/linux/home      nullfs          rw,late                 0       0
/tmp            /compat/linux/tmp       nullfs          rw,late                 0       0
```

$ kldstat | grep linux

```
3    7 0xffffffff83a32000     d770 linux_common.ko
 4    3 0xffffffff83a40000    b2868 linux.ko
14    1 0xffffffff84226000    35cb0 linux64.ko
```

uname -a

```
FreeBSD freebsd 12.2-RELEASE FreeBSD 12.2-RELEASE r366954 GENERIC  amd64
```

Thanks


----------



## bsdavguser (Aug 6, 2021)

Hi, FreeBSD community.

This is my first time posting here and I am not sure if this is the right place to troubleshoot my issue - apologize if not.

Last night I was trying to install Chrome using the mrclksr script which is built based on the instructions provided in this post. 

The script installation was smooth and straightforward. However, when trying to run Chrome, Brave, Vivaldi, I am getting the output shown below:


```
freebsd@freebsd13:/usr/home/freebsd $ /usr/local/bin/linux-chrome
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.
[2448:101949:0806/114322.551647:ERROR:file_path_watcher_linux.cc(326)] inotify_init() failed: Function not implemented (38)
Gtk-Message: 11:43:22.939: Failed to load module "colorreload-gtk-module"
Gtk-Message: 11:43:22.940: Failed to load module "window-decorations-gtk-module"
[2448:101953:0806/114322.950387:ERROR:bus.cc(393)] Failed to connect to the bus: Did not receive a reply. Possible causes include: t
he remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the net
work connection was broken.
[2448:2448:0806/114322.950508:ERROR:proxy_config_service_linux.cc(609)] inotify_init failed: Function not implemented (38)
[2448:101949:0806/114322.953071:ERROR:address_tracker_linux.cc(195)] Could not create NETLINK socket: Address family not supported b
y protocol (97)
[2448:101949:0806/114322.954907:ERROR:udev_watcher.cc(52)] Failed to initialize a udev monitor.
[0806/114322.956338:ERROR:ptracer.cc(476)] Unexpected registers size 0 != 216, 68
[0806/114322.956573:ERROR:proc_task_reader.cc(45)] format error
[2448:2448:0806/114322.983646:ERROR:proxy_config_service_linux.cc(609)] inotify_init failed: Function not implemented (38)
[2448:101962:0806/114322.984311:ERROR:bus.cc(393)] Failed to connect to the bus: Did not receive a reply. Possible causes include: t
he remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the net
work connection was broken.
[2448:101962:0806/114322.985467:ERROR:bus.cc(393)] Failed to connect to the bus: Did not receive a reply. Possible causes include: t
he remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the net
work connection was broken.
[2454:101965:0806/114322.995849:ERROR:file_path_watcher_linux.cc(326)] inotify_init() failed: Function not implemented (38)
[2454:101967:0806/114322.995997:ERROR:address_tracker_linux.cc(195)] Could not create NETLINK socket: Address family not supported b
y protocol (97)
[2448:101962:0806/114323.011820:ERROR:bus.cc(393)] Failed to connect to the bus: Did not receive a reply. Possible causes include: t
he remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the net
work connection was broken.
[2448:101962:0806/114323.012174:ERROR:bus.cc(393)] Failed to connect to the bus: Did not receive a reply. Possible causes include: t
he remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the net
work connection was broken.
[2454:101967:0806/114323.112257:ERROR:address_tracker_linux.cc(195)] Could not create NETLINK socket: Address family not supported b
y protocol (97)
[2448:101976:0806/114323.131896:ERROR:bus.cc(393)] Failed to connect to the bus: Did not receive a reply. Possible causes include: t
he remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the net
work connection was broken.
[2448:101976:0806/114323.132474:ERROR:bus.cc(393)] Failed to connect to the bus: Did not receive a reply. Possible causes include: t
he remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the net
work connection was broken.
[2448:101976:0806/114323.132873:ERROR:bus.cc(393)] Failed to connect to the bus: Did not receive a reply. Possible causes include: t
he remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the net
work connection was broken.
[2448:101976:0806/114323.133120:ERROR:bus.cc(393)] Failed to connect to the bus: Did not receive a reply. Possible causes include: t
he remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the net
work connection was broken.
[2448:101976:0806/114323.133404:ERROR:bus.cc(393)] Failed to connect to the bus: Did not receive a reply. Possible causes include: t
he remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the net
work connection was broken.
Illegal instruction (core dumped)
freebsd@freebsd13:/usr/home/freebsd $
```

The browser window appears for a few seconds without any content and closes.

I installed Linux binary compatibility based on the instructions provided here. 

Would highly appreciate any help in this matter.

Stay safe.


----------



## patovm04 (Aug 6, 2021)

bsdavguser said:


> Hi, FreeBSD community.
> 
> This is my first time posting here and I am not sure if this is the right place to troubleshoot my issue - apologize if not.
> 
> ...


I don't think you did anything wrong. There seems to be an issue with Chromium v92+ and certain systemd libs. Thus it is not related to FreeBSD or Linuxulator as far as I understand. So I'm staying at v91 at the moment, as I don't know how to fix it


----------



## ziomario (Feb 13, 2022)

After several attempts I've been able to install succesfully Chrome (not Chromium),following this tutorial :









						[Linuxulator] How to run Google Chrome (linux-binary) on FreeBSD
					

[Update] For new instructions targeting FreeBSD 13.0 and newer, please see: https://forums.freebsd.org/threads/linuxulator-how-to-install-brave-linux-app-on-freebsd-13-0.78879/   Important notes:  1) Tested upon FreeBSD 12.2-RELEASE. Used Ubuntu-based linux compat instead of default CentOS one...




					forums.freebsd.org
				




It runs without problems,it's a shame that it does not allow to install extensions,because a bug that has been fixed for chromium,but not for Chrome,as u can see below : (and yes,I'm running the latest version,97. I mean,this bug has been fixed for chromium version 97,but not for chrome 97). Lamia : what do u think ?


----------



## ziomario (Feb 14, 2022)

brave is also affected :


----------



## grahamperrin@ (Feb 14, 2022)

ziomario said:


> … this bug has been fixed for chromium version 97,but not for chrome 97 …



Yes, <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258573#c17> I do wonder what the fix was. 


ziomario please note, I have 258573 still open only because information about the fix is missing; whilst Chrome is a side interest, it is (technically) not the wwww/chromium port; there is no port of Google Chrome. Thanks.


----------



## ziomario (Feb 14, 2022)

I know. That's because I'm working hard to run google chrome from a long time.


----------



## Lamia (Feb 14, 2022)

ziomario said:


> _*[FONT=monospace]Lamia[/FONT]*_ : what do u think ?


Sorry, I have been busy with fabricating a casing for one of our Pandaboards with Chipsee Touchscreen.


----------



## ziomario (Feb 14, 2022)

I'm not able to change the user agent on google chrome with the extensions "UserAgent-Switcher"
					

Hello to everyone.  After several attempts I've been able to install successfully Google Chrome (not Chromium),following this tutorial :  https://forums.freebsd.org/threads/linuxulator-how-to-run-google-chrome-linux-binary-on-freebsd.77559/  It runs without problems,it's a shame that it does not...




					forums.freebsd.org


----------

