How to run a reverse proxy VM on your BI...

General discussion about Blue Iris
HeneryH
Posts: 739
Joined: Thu Jul 18, 2019 2:50 pm

How to run a reverse proxy VM on your BI...

Post by HeneryH »

In case anyone was interested here are some notes.

The Goal -
  • Reverse Proxy lets you run a very secure Linux Server with Nginx web server on your network. These tend to be more secure than windows machines that have been boogered up with god knows what.
  • The reverse proxy can accept incoming connections and route those connections to BI or whatever other servers you may have running. I have a BI instance running in my home but also several other servers. The single reverse proxy knows what the incoming connection looks like and routes appropriately.
  • IF you have a domain name registered, you can also use free Let'sEncrypt service to create SSL certs to get the nice green lock on the browser without having to accept the warning that self-signed certs always flag.
HeneryH
Posts: 739
Joined: Thu Jul 18, 2019 2:50 pm

Re: How to run a reverse proxy VM on your BI...

Post by HeneryH »

Download Oracle's VirtualBox VM host. You can use any tool you like but these instructions use VirtualBox.

https://www.virtualbox.org/wiki/Downloads

Nomenclature -- Host is your Windows machine. Guests are the VMs.

I also download the extension pack but those are really more useful if you install full UI guests rather than command line only guests. After you install VBox then you can double-click the extension pack and it will install.

Image
HeneryH
Posts: 739
Joined: Thu Jul 18, 2019 2:50 pm

Re: How to run a reverse proxy VM on your BI...

Post by HeneryH »

You'll need a variant of Linux. I used Fedora because I had some other specifics that worked out better with Fedora but most people seem to like Ubuntu. I might tend to lean towards Ubuntu if you are new. I'll try to note any differences.

When downloading Linux distributions you are usually offered full desktop UI versions or just server command line versions. I started with UI desktops but to keep the service light I went with a server version. When using the server version it helps to have an Xterm/SSH app that lets you log into the server and fully utilize copy/paste commands. The copy/paste between VMs is something everyone runs into at one point. The Extension Pack from VBox is supposed to help with this.

Anyway, I grabbed the Server version of Fedora from https://getfedora.org/en/ The Net-Install version is a smaller ISO but needs to use the internet to get most of the info, the full ISO has everything all in one.

and MobaTerm from https://mobaxterm.mobatek.net/
HeneryH
Posts: 739
Joined: Thu Jul 18, 2019 2:50 pm

Re: How to run a reverse proxy VM on your BI...

Post by HeneryH »

Create a VM for your newly downloaded variant of Linux by hitting the blue 'new' star icon ...

You'll need to name your instance with whatever name you want.

Image

If you only see 32-bit versions then you may need to go to your BIOS and enable virtualization. I'll get the exact name when I reboot now. I'm grabbing these screen shots on a home use machine and just realized now that it happened here. The setting is called "Intel Virtualization Technology" in your BIOS and it needs to be enabled. Then you can get the 64 bit versions.

Image
Last edited by HeneryH on Sun Jan 19, 2020 7:15 pm, edited 3 times in total.
HeneryH
Posts: 739
Joined: Thu Jul 18, 2019 2:50 pm

Re: How to run a reverse proxy VM on your BI...

Post by HeneryH »

Choose your name and machine type for the "new'" VM. And hit next.

I created a VM with 3 GB (3000 MB) of memory (I have 16GB on the machine) which is fine for a simple reverse proxy only server. If you want full UI you may need more.

Choose to create a new VDI virtual disk now. Dynamically allocated. You can probably get away with even less than 100 gb if space is short. Making one now with 100gb disk and it looks like plenty.

Before we start the instance and install the OS, lets make a few tweaks...

Image


The default network is to share the same IP address as your host machine and translate the traffic through your host machine. Since we are making a secure network interface device I want this new VM to show up as a completely separate machine. Right click on your new VM Icon and change the settings. Change the network type from NAT to Bridged Adapter. This means that your VM will look like a separate machine.

Image

After making that change, start your VM. It will ask for a startup disk. This is like putting an installer CD into a machine. Select your ISO for whatever variant of Linux you downloaded. The little foler icon will let you browse for you iso file. Hmmm this UI looks a little different from the last time I did this. Maybe lets try and "Add" to mount our ISO... That seem like it. Start it.

This will go through the installer process. Sometimes when you click into a VM it kind of grabs your mouse and holds it. In the lower right of the VM window you will see a hint about Right Ctl... that will escape your mouse back to the host.

Linux doing its thing....

Image
Last edited by HeneryH on Mon Jan 20, 2020 3:55 am, edited 3 times in total.
HeneryH
Posts: 739
Joined: Thu Jul 18, 2019 2:50 pm

Re: How to run a reverse proxy VM on your BI...

Post by HeneryH »

At the installer UI you can select a few things and create a user and root-user.

Fedora -

Some of these things are mandatory before proceeding.

Image <-- I think you scroll down for setting a user for yourself.
  • The easy ones you just click on and say yes.
  • The System Installation disk DON'T BE SCARED ABOUT OVERWRITING YOUR DISK, it is your VM disk that is is talking about, not your windows disk. This changed since last time I did this. Now I think you need to use the Custom option for creating disk partitions. When in the custom partition setup, hit the link that says create defaults. But this will only set a 15gb / (root) partition leaving a lot of unused space on your virtual disk. I deleted the pre set / folder then recreated it using all of the free space. That worked well for me.
  • If you have a domain name you like to use , you can use that in your machine name in the Network and Host section. Or you can just keep localhost.localdomain. Actually I would at least give it a machine name because that will likely show up in our router as a machine in later steps. I called it "r-proxy.localdomain" for now.
  • In the software selection, this is a basic server so you don't need anything extra. Later if you want to experiment with Docker or something you can always install them later.
  • Set a root password.
  • Create a user account for yourself and make sure you are admin. Begin the install...

Ubuntu -
For Ubuntu install, there were a couple of rudimentary configs using tab and enter to set. I just took nearly all of the defaults and chose 'entire disk' without LVM for my disk config. Remember that we are only talking about the entire 100g VM disk, not the Windows disk. I think LVM gives some benefits but at some ease of use costs. Never dug into that.

Image

Image

Image

Image

When done and ready to reboot, force the disk eject same as for Fedora and reboot. Looks like it is reporting an error, maybe because I forced a disk eject. Just hard close it and restart. It will reboot and get to the same login screen.
Last edited by HeneryH on Mon Jan 20, 2020 4:01 am, edited 5 times in total.
HeneryH
Posts: 739
Joined: Thu Jul 18, 2019 2:50 pm

Re: How to run a reverse proxy VM on your BI...

Post by HeneryH »

OK, the disk stuff changed since the last time I did this.

In the disk section, check the disk you allocated at the beginning then select the 'custom' partition option.

I chose LVM method and then clicked the URL that says create default.

But this only sets aside 15GB for root which is basically everything other than the required partitions. Delete this root, then re-add it with the available space.

Create your root and user as noted above.
HeneryH
Posts: 739
Joined: Thu Jul 18, 2019 2:50 pm

Re: How to run a reverse proxy VM on your BI...

Post by HeneryH »

After installation when sitting at the "Reboot System" button, before hitting reboot, eject the installer disk. Force an un-mount then reboot.

Image
HeneryH
Posts: 739
Joined: Thu Jul 18, 2019 2:50 pm

Re: How to run a reverse proxy VM on your BI...

Post by HeneryH »

After reboot, your new server is running.

Fedora

Image

Ubuntu

Image
Last edited by HeneryH on Sun Jan 19, 2020 9:08 pm, edited 1 time in total.
HeneryH
Posts: 739
Joined: Thu Jul 18, 2019 2:50 pm

Re: How to run a reverse proxy VM on your BI...

Post by HeneryH »

Log into your home router and make sure that you can see your new VM instance and perhaps use your router to give this machine a constant (ie kind of like static) address.

Image

It is just easier to use a copy/paste friendly tool to log into the server since you'll be spending a lot of time copying samples from all over. That is how I learned. I use the free MobaXterm https://mobaxterm.mobatek.net/download- ... ition.html

Create a new SSH session to your machine.

Image

Image
Post Reply