There are other ways of doing this, not using a virtual machine, but I wanted to use something with a low risk of breaking if there are any software updates in the future.
This solution is only good for accessing Intranet Web sites and for ssh connections, which is exactly what I need.
Here's what working from home looks like now:
- Power on the laptop choosing Fedora boot.
- Log in.
- Start VirtualBox.
- Start the Windows 7 VM without the GUI (headless).
- Close VirtualBox.
- Start Remote Desktop.
- Connect to the Windows 7 VM.
- Click the SmartConnect icon to connect to the VPN.
- Confirm the connection in the Duo Android App.
- Close Remote Desktop.
The VPN session lasts the whole day.
- Start an ssh session to the Windows 7 VM with SOCKS enabled.
- Connect to a work server to work from for the day with 'screen'.
- Start a Web Browser.
- Click the 'Socks Proxy' plugin button.
- Log in to Jira, Wiki, etc.
Setting it all up on Fedora 22
If they aren't installed already, install VirtualBox and Vagrant.
sudo cat >/etc/yum.repos.d/virtualbox.repo <<EnD
name=Fedora $releasever - $basearch - VirtualBox
sudo dnf install virtualbox vagrantAfter installation go to the Web Site and install the VirtualBox Extensions so that virtual machines can be started without a GUI (headless) later.
Get a Windows image from vagrant.
This minimal Windows 7 box has an ssh server, BitVise, already installed as a service and a bash shell, Git Bash, so there's not much to do once it's installed.
vagrant init ferventcoder/win7pro-x64-nocm-lite
vagrant up --provider virtualbox
Once Vagrant has started, stop it.
Download Firefox for Windows and put it in the win7 folder.
Google for Firefox and download the 64 bit Windows version then put it in the win7 folder created earlier. This folder is accessible by the virtual machine when it's running so Firefox can be easily installed inside the VM.
Start the Windows 7 virtual machine and configure it.
Start VirtualBox then start the Windows 7 VM that vagrant created.
Click on Network then VBOXSVR and open the share.
Run the 'Firefox Setup...' executable to install it.
Now that it's installed, open Firefox and search for Microsoft Security Essentials then download and install it. This is required for SmartConnect to work - it will complain otherwise.
Use Firefox again to get SmartConnect DUO from your IT department. They will have supplied a Web address to get the client from.
Run SmartConnect with DUO and connect to the corporate VPN.
The Windows installation is very limited, but enough of it works to make it completely usable as a VPN proxy.
Minimise the Windows 7 VM window. We don't need it anymore.
SSH to the Windows 7 VM
The following ssh command connects to the VM with SOCKS 4 enabled on port 1337. Use the password, 'vagrant', when prompted.
ssh -D1337 -p2222 firstname.lastname@example.orgI use this terminal to connect to other hosts on the corporate network using ssh. A bash terminal is available by typing 'bash', '~/.ssh/authorized_keys' can be used (but tick the 'use authorized_keys file' in BitVise), and public/private keys can be put in '~/.ssh/'.
By default the terminal foreground colour is green. Type 'color 7' to make it white.
Install 'Socks Proxy' in the Firefox Web browser.
Install Socks Proxy from Add Ons and set it up as shown:
Other proxies, such as Foxy Proxy, could be used to selectively choose when the socks proxy is used, but this one is really simple, and it works, although all Web traffic will go through the proxy.
Try connecting to corporate Web sites.
Enable the socks proxy plugin using the toolbar button .
Navigate to corporate Web sites and they should work, even web sites that specify ports to use.
No screen clutter - use a headless Windows 7 VM
Windows 7 can be started in headless mode by pressing the 'shift' key when starting the virtual machine in the VirtualBox GUI. Then Remote Desktop can be used to start/stop the VPN. These are the Remote Desktop settings: