Home » ChromeOS » This App Lets You Share Your Ubuntu’s WiFi With Android

This App Lets You Share Your Ubuntu’s WiFi With Android

by Pratik
0 comment

Unlike Windows 10, Ubuntu doesn’t let you turn on both Wi-Fi and hotspot at the same time. This might not be an issue when you are on your home Wi-Fi. However, when you move to a cafe, airport or hotel where the Internet is restricted to one device per user, things can get a bit problematic. However, I recently discovered an app for Linux that lets you share your laptop’s Wi-Fi via ADB. Let’s see how.

This App Lets You Share Your Ubuntu’s WiFi With Android

“Gnirehtet” is an open-source app from the popular makers of ScrCpyGenymobile. The app functions over ADB and hence you would require to connect your Android to the laptop via a USB cable. The app makes use of reverse tethering which is an “adb reverse” command that was introduced way back in Android 5.0. So in simple words, it sends your Android web requests to the webserver via your laptop. Hence, the webserver believes that the request is made by the laptop itself. This way, it is using the laptop as a proxy.

For the Gnirehtet app to work, you would need to install ADB on Ubuntu. Use the following command to do that.

sudo apt-get install adb

adb-install-command

Once you have ADB installed, download the Gnirehtet zip file for Linux. Note that, there are 2 variants: Linux and Rust. Use the Rust one as it doesn’t require setting up a Java runtime environment.

download-gnirehtet-app

After you have downloaded the zip file, extract it. You would see 2 files within it – a compiled Rust file and an APK file. The APK file has to be installed on the Android device. Now, you can either send the APK file to your Android device and install it or use the Gnirehtet command to automatically do it.

Turn on USB debugging on your Android device.

But before you run the command, connect your Android to the laptop and enable USB Debugging through the developer options on your Android phone. Next, navigate to the extracted Gnirehtet folder to run the following command.

./gnirehtet install

gnirehtet-client-install

After the successful installation of the client app, run the following command on your computer to start sharing the Wi-Fi connection.

./gnirehtet run

gnirehtet-run-command - create wifi hotspot ubuntu

You would also receive a prompt on the Android to accept the VPN creation by Gnirehtet. This is because Gnirehtet transfers the data from your Android device to the laptop via a VPN channel.

gnirehtet-vpn-request-on-android - create wifi hotspot ubuntu

This method works with multiple Android devices. Although I haven’t tried the limit, it seemed to be working fine for 2 Android devices simultaneously. However, when you have multiple devices connected to your laptop, you need to append the adb device number along with the run command. To find the device number, use the following adb command.

adb devices

adb-devices-serial-number

Next, use the serial number to start the Internet on a specific Android device.

 ./gnirehtet run 27f42c49df217ece

multiple-device-run-command - create wifi hotspot ubuntu

Now, adb can also function over Wi-Fi but that still requires connecting your device with a USB cable for the initial setup. Hence, I am ignoring that particular part. For more issues or queries, let me know in the comments below.

Also Read: How to Quickly Create Keyboard Shortcuts in Ubuntu

You may also like

Leave a Comment