Raspberry Pi is a single-board computer which is also an IoT device. Using this you can use a Linux desktop and also do awesome IoT projects. Recently Raspberry Pi 4B introduced with dual 4K HDMI ports. Those who have a display with HDMI ports, can easily setup & use Raspberry Pi 3B/4B.
But those who are laptop/notebook user, it is not possible to use HDMI ports for display. They need to use Virtual Network Computing (VNC) in order to remotely access Raspberry Pi in Desktop Mode or Secure Shell (SSH) for the command line.
Unfortunately, the Raspbian OS comes with VNC & SSH disabled. So normally you need to connect Raspberry Pi with keyboard & Monitor for the setup after flashing Raspbian in SD card. Here in this post, I will share how to enable VNC SSH without Monitor & Router. Many tutorials on the web show to connect Raspberry Pi with Ethernet port of Router. But here I will do it without any Router.
Things you Need
- Raspberry Pi 3B / 3B+ / 4B Board
- Android Mobile
- USB Data Cable
You may also watch the tutorial on video
Download & Flash Raspbian OS
First we have to download and flash latest Raspbian Build to a class 10 SD card. Follow the post below to see flashing tutorial.
Enable SSH on Raspberry Pi 3B/4B
By default Raspbian comes with SSH Disabled. To enable it, first insert SD card to your desktop/laptop after flash complete.
In the boot partition create a blank file named “ssh” without any extension. This will enable SSH from first boot on Raspbian OS. After this remove the SD card and insert it on Raspberry Pi board.
Connect Raspberry Pi 3B/4B with Android Mobile
After powering on Raspberry Pi, connect it with any Android Mobile via USB Data cable.
After connecting with USB, Enable USB Tethering on your Android mobile.
Then download Network Scanner App From Play Store.
Find Raspberry Pi 3B/4B IP Address
Now open the app and Scan External Network and specify IP as “192.168.42.1/24” and port 22.
After scanning complete one device will show. Just Copy that IP.
Log in to Raspberry Pi via SSH
Now download Juice SSH app from play store and connect with the IP address found in network scanner.
Use the following username and password for login into Raspberry pi.
Now run command “sudo raspi-config”.
Enable VNC on Raspberry Pi 3B/4B
To enable VNC, we have to do 3 settings inside raspi-config window.
First go to Boot Options and select the last option of Auto login with desktop.
Next, go to interfacing options and select VNC & enable it.
Lastly, we have to select display resolution. To do this, go to Advanced option from main menu and select Resolution option.
Depending upon your Laptop/Notebook Screen Resolution select resolution here. Here I am selecting 720p/1080p resolution as it is 16:9 aspect ratio.
After this you will be asked to reboot.
Connect Raspberry Pi 3B/4B with VNC Viewer
After Raspberry Pi finishes reboot, again enable USB Tethering on your Android mobile & open Network Scanner to find new IP Address of Raspberry Pi 3B/4B.
Then, Download VNC viewer from Play store.
Now connect VNC viewer with new IP address & same login credentials used before in SSH login.
Now your Raspberry Pi is ready to use in GUI mode. Just complete Welcome Wizard and connect to your mobile WiFi hotspots and Reboot.
You may also set a static IP Address manually in the network settings for your WiFi/ Ethernet port.
This will set a fixed IP and you can log in & remotely access in future from laptop/notebook without scanning the network every time.