This App Lets You Share Your Ubuntu’s WiFi With Android.
Unlike Windows 10, Ubuntu doesn’t let you turn on Wi-Fi and hotspot at the same time. This may not be a problem if you are connected to your home Wi-Fi. However, when you move to a coffee shop, airport or hotel where internet access is limited to one device per user, things can get a little problematic. However, I recently discovered a Linux app that allows you to share your laptop’s Wi-Fi via ADB. Let’s see how.
This app allows you to share Ubuntu’s WiFi with Android
“Gnirehtet” is an open source application from the popular ScrCpy maker Genymobile. The app works over ADB, so you’ll need to connect your Android to your laptop via a USB cable. The app uses a reverse modem, which is the “adb reverse” command that was introduced back in Android 5.0. In simple terms, it sends your Android web requests to the web server through your laptop. Therefore, the web server considers the request to be made by the laptop itself. Thus, it uses the laptop as a proxy.
In order for the Gnirehtet application to work, you need to have ADB installed on Ubuntu. To do this, use the following command. sudo apt-get install adb
After installing ADB, download the Gnirehtet zip file for Linux. Please note that there are 2 options: Linux and Rust. Use Rust as it doesn’t require any Java runtime setup.
Once you’ve downloaded the zip file, unzip it. You will see 2 files in it – the compiled Rust file and the APK file. The APK file must 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 do it automatically.
Enable USB debugging on your Android device.
But before running the command, connect Android to laptop and enable USB debugging in developer options on Android phone. Then go to the extracted Gnirehtet folder to run the following command. ./gnirehtet install
After successfully installing the client application, run the following command on your computer to start sharing your Wi-Fi connection. ./gnirehtet run
You will also receive a request for Android to accept VPN creation from Gnirehtet. This is because Gnirehtet transfers data from your Android device to your laptop over a VPN.
This method works with multiple Android devices. Although I haven’t tried this limit, it seems to work fine for two Android devices at the same time. However, if you have multiple devices connected to your laptop, you need to add the adb device number along with the start command. To find out the device number use the following adb command. adb devices
Then use the serial number to launch the internet on a specific Android device. ./gnirehtet run 27f42c49df217ece
Now adb can also work over Wi-Fi, but initial setup still requires your device to be connected with a USB cable. Hence, I am ignoring this particular part. If you have further problems or questions, let me know in the comments below.
Also Read: How To Quickly Create Keyboard Shortcuts In Ubuntu