Skip to content
Sign upLog in
← Back to Community

How to connect to your REPL through VNC

Profile icon
Seven7Four4

Hey all,
I recently wondered, how do I connect to a REPL through my own website? I did my research and I saw a Replit blog that explained it. At first it didn't work but I put matters into my own hands and made it easier to do.

First, create your REPL. Before even copy/pasting code or adding code, you need to go to Secrets > Add secret. Name it VNC_PASSWORD and put the value as whatever you want. This is important to connect to your REPL.

Once you have set up the password, add your code and whatever. Run it, and then once there is a graphical display, we can connect to it.

To connect it, you can do it one or two ways:
One: Use my website to connect to your REPL in a simpler way,
Two: Use the main NoVNC page to connect to it

I will be focusing on my website, although if you want to use the NoVNC page, you can view this tutorial: https://docs.replit.com/hosting/streaming-native-graphics-vnc

Open up a new window. In there, paste this:
https://childlike-polar-plot.glitch.me/?password={VNC_PASSWORD}&replit-username={YOUR USERNAME HERE}&repl-name={REPL NAME HERE}

Replace {VNC_PASSWORD} with the secret that you set earlier, {YOUR USERNAME HERE} with your Replit username, and {REPL NAME HERE} with the name of your REPL.

If you followed my steps correctly, it should look like this:
ezgif-7-ae293f51167c

If it didn't work, check that you put your "VNC_PASSWORD" secret before running your code, or check if it's if there at all! If not, create a new REPL and put the secret before running your code.

If this helped you with something, thanks for sticking around.

Till' next time,
Seven7Four4

Voters
Profile icon
azlancoding
Profile icon
Highwayman
Profile icon
MrVoo
Profile icon
Seven7Four4
Comments
hotnewtop
Profile icon
azlancoding

I need a bit of help, I'm unable to setup this NoVNC thingy for my replit. Please help!
https://replit.com/@azlancoding/virtual-browser-beta
my VNC_PASSWORD is abcdefg

Profile icon
Seven7Four4

@azlancoding
What do you mean by that?

Profile icon
azlancoding

I kinda made my code first then had the idea of VNC and then added the VNC_PASSWORD variable. So how can I fix this

Profile icon
azlancoding

@Seven7Four4
When I tried the link:
https://childlike-polar-plot.glitch.me/?password=abcdefg&replit-username=azlancoding&repl-name=virtual-browser-beta
But up till now, it's still loading.

and I tried it here:
https://novnc.com/noVNC/vnc.html
and got "无法连接到服务器" meaning it failed to connect to the server.
Also, idk why that webpage received by my chromebook is in chinese while it's in English on my samsung hp.

Profile icon
Seven7Four4

@azlancoding
Fork it and re-add the VNC password to your environment variables. Don't run it until after you have entered the VNC password.

Profile icon
azlancoding

@Seven7Four4
Ok Thanks. I'll try that tmr and let you know the results. Gd night for now! (assuming your timezone is GMT+8) 😄

Profile icon
AstroIsTaken

how did you install macos

Profile icon
mkcodes

could you migrate the glitch project to replit? our school blocked glitch:(

Profile icon
Highwayman

Noice, but you never explained the normal way of doing it, or linked the blog post…

Profile icon
Seven7Four4

@Highwayman
I linked it...

Profile icon
Highwayman

Oh wait yeah you did, I just scrolled straight to the meat XD oops.

@Seven7Four4