Skip to content

Instantly share code, notes, and snippets.

@drexler

drexler/install.sh

Created May 24, 2018
Embed
What would you like to do?
Install Chrome under WSL
# assumes you have ubuntu-desktop installed which includes stock libpulse
sudo add-apt-repository ppa:therealkenc/wsl-pulseaudio
sudo apt-get update && sudo apt-get upgrade
# Download the stable or development Chrome .deb package - dev if you want headless functionality
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt -f install # probably
wget https://github.com/therealkenc/libudev-stub/releases/download/v0.9.0/libudev-stub-0.9.0-WSL.deb
sudo dpkg -i libudev-stub-0.9.0-WSL.deb # doing this **last** is important
@Griefchief

This comment has been minimized.

Copy link

@Griefchief Griefchief commented Jul 14, 2019

Remove "sudo apt-get upgrade" from line 3 cause it will cause you to ctrl-c it if you don't update regularly, and then you'll have to "dpkg configure -a" it to let it finish... in my case it hands at mysql so i had to sudo apt remove it...

Also, it's probably just easier to "just" setup the install through apt-get instead of dpkg directly. In my case though, that solution forces me to run WSL as Administrator to avoid the chrome startup crash, where it complains about user namespaces being available on the system, but permission being denied for them... I don't know if the above solution suffers from the same problem, but it probably should, since it's related to chrome internals.

@meetKazuki

This comment has been minimized.

Copy link

@meetKazuki meetKazuki commented Jul 15, 2019

I keep getting this error

apt: /lib/x86_64-linux-gnu/libudev.so.1: no version information available (required by /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0)
UDEV STUB: Using libudev-stub 0.9.0

whenever I try to install any package. I've not been able to install any package since.
Any suggestions?

@jo-quin

This comment has been minimized.

Copy link

@jo-quin jo-quin commented Aug 26, 2019

Hi I have the same problem than meetKazuki. Any suggestions?

@caseyjkey

This comment has been minimized.

Copy link

@caseyjkey caseyjkey commented Aug 26, 2019

After following your instructions, I get this error on Ubuntu 18.04 with VcXsrv running:

~ google-chrome [840:840:0826/142818.473250:ERROR:browser_dm_token_storage_linux.cc(101)] Error: /etc/machine-id contains 0 characters (32 were expected). [840:861:0826/142818.581300:ERROR:bus.cc(394)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory UDEV STUB: Using libudev-stub 0.9.0 UDEV STUB: udev_new() UDEV STUB: stubbing udev... UDEV STUB: udev_monitor_new_from_netlink() name: udev UDEV STUB: udev_monitor_filter_add_match_subsystem_devtype() subsystem: sound devtype: (null) UDEV STUB: udev_monitor_filter_add_match_subsystem_devtype() subsystem: video4linux devtype: (null) UDEV STUB: udev_monitor_enable_receiving() UDEV STUB: udev_monitor_get_fd() libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast [875:875:0826/142818.890022:ERROR:gl_surface_glx.cc(78)] XGetWindowAttributes failed for window 3145732. [875:875:0826/142818.890202:ERROR:gl_surface_glx.cc(817)] Failed to get GLXConfig [875:875:0826/142818.890235:ERROR:gpu_info_collector.cc(50)] gl::GLContext::CreateOffscreenGLSurface failed [875:875:0826/142818.890246:ERROR:gpu_info_collector.cc(179)] Could not create surface for info collection. [875:875:0826/142818.890255:ERROR:gpu_init.cc(64)] gpu::CollectGraphicsInfo failed. [875:875:0826/142818.895436:ERROR:viz_main_impl.cc(170)] Exiting GPU process due to errors during initialization [840:962:0826/142819.247065:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix") [840:857:0826/142819.254408:ERROR:data_store_impl.cc(131)] Failed to open Data Reduction Proxy DB: 3 (google-chrome:840): LIBDBUSMENU-GLIB-WARNING **: 14:28:19.619: Unable to get session bus: Unknown or unsupported transport “disabled” for address “disabled:” [840:1025:0826/142819.773105:ERROR:bus.cc(394)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory [840:1025:0826/142819.773344:ERROR:bus.cc(394)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory [840:1025:0826/142819.773819:ERROR:bus.cc(394)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory [840:1025:0826/142819.774112:ERROR:bus.cc(394)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory [840:1025:0826/142819.774375:ERROR:bus.cc(394)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory [840:858:0826/142820.703495:FATAL:gpu_data_manager_impl_private.cc(894)] The display compositor is frequently crashing. Goodbye.

Fixed by following microsoft/WSL#648 (comment)

@drexler

This comment has been minimized.

Copy link
Owner Author

@drexler drexler commented Aug 27, 2019

@caseykey @jo-quin @meetKazuki i apologize for the late reply. I haven't looked at this in ages since i've switched from using Windows with WSL to Macs. It's precisely these kinds of issues & workarounds that drove me away.

@jo-quin

This comment has been minimized.

Copy link

@jo-quin jo-quin commented Aug 27, 2019

@drexler Don't worry! It is quite challenging to work with WSL. I ended up not using WSL for my project.

@lackovic

This comment has been minimized.

Copy link

@lackovic lackovic commented Jan 7, 2020

I am still happily using WSL and looking forward for WSL 2 to be completed!

Here is a couple of Chrome related links which were helpful to me:

@GuyGoldenberg

This comment has been minimized.

Copy link

@GuyGoldenberg GuyGoldenberg commented May 15, 2020

I keep getting this error

apt: /lib/x86_64-linux-gnu/libudev.so.1: no version information available (required by /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0)
UDEV STUB: Using libudev-stub 0.9.0

whenever I try to install any package. I've not been able to install any package since.
Any suggestions?

It seems like this script can brake the symlink which is used by apt to load the libudev.so.
To fix this locate the real libudev.so on your machine (ls -l /lib/x86_64-linux-gnu/libudev.so.*).
On my machine it's /lib/x86_64-linux-gnu/libudev.so.1.6.9.

Then, override the symlink by running

sudo ln -s /lib/x86_64-linux-gnu/libudev.so.{YOUR_VERSION} /lib/x86_64-linux-gnu/libudev.so.1
@ZhigangPu

This comment has been minimized.

Copy link

@ZhigangPu ZhigangPu commented Jun 8, 2020

I keep getting this error

apt: /lib/x86_64-linux-gnu/libudev.so.1: no version information available (required by /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0)
UDEV STUB: Using libudev-stub 0.9.0

whenever I try to install any package. I've not been able to install any package since.
Any suggestions?

It seems like this script can brake the symlink which is used by apt to load the libudev.so.
To fix this locate the real libudev.so on your machine (ls -l /lib/x86_64-linux-gnu/libudev.so.*).
On my machine it's /lib/x86_64-linux-gnu/libudev.so.1.6.9.

Then, override the symlink by running

sudo ln -s /lib/x86_64-linux-gnu/libudev.so.{YOUR_VERSION} /lib/x86_64-linux-gnu/libudev.so.1

exactly this

@kev26

This comment has been minimized.

Copy link

@kev26 kev26 commented Oct 8, 2020

I am still happily using WSL and looking forward for WSL 2 to be completed!

Here is a couple of Chrome related links which were helpful to me:

You had saved my life <3

@jenipharachel

This comment has been minimized.

Copy link

@jenipharachel jenipharachel commented Dec 1, 2020

@kev26 @lackovic Is it possible to use chrome without the chromedriver in WSL, since chromedrivers are said to be installed for WSL2, whereas I'm using WSL1

@lackovic

This comment has been minimized.

Copy link

@lackovic lackovic commented Dec 2, 2020

@kev26 @lackovic Is it possible to use chrome without the chromedriver in WSL, since chromedrivers are said to be installed for WSL2, whereas I'm using WSL1

Sorry, I don't know about WSL1: the best thing you can do is to migrate to WSL2, it is so much better it is really not worth to stay on WSL1.

@veena-LINE

This comment has been minimized.

Copy link

@veena-LINE veena-LINE commented Dec 6, 2020

If it helps anyone,
instead of installing chrome exclusively for WSL (mine's WSL1), here's what worked for me with whatever was installed on Windows:
Since ~/.bashrc references .bash_aliases, use any editor. I'm using nano here:

$ nano ~/.bash_aliases
alias chrome="powershell.exe -Command start chrome"
alias firefox="powershell.exe -Command start firefox"

Without re-starting Bash, just type:

$source ~/.bashrc

Test with alias name:

$chrome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment