Showing posts with label Virtual Box. Show all posts
Showing posts with label Virtual Box. Show all posts

Saturday, August 1, 2020

VPN Gateway VM in VirtualBox (with Kill Switch)

PDF - version

Setup:

  • A Linux host PC (Ubuntu 18.04/20.04) Running an up-to-date Virtual Box.
  • Guest: A headless Virtual server (Ubuntu 18.04/20.04)
  • Valid VPN account with a 3rd party. (in my case: NordVPN)

Goal:

  • Start the virtual machine (guest) headless as a service when booting the Host machine.
  • The VM must be able to log in automatically as a service without manually providing account credentials 
  • The VM uses a bridged network so it has a reachable IP on the LAN
  • Using the VM-IP as a gateway for devices that need a VPN connection.
  • No other outbound connection possible for devices using this gateway when the VPN-connection to NordVPN goes down, No internet connection is available.

Monday, May 23, 2016

UEFI - Windows Product Key retrieval in Lunux

Trying to install a fresh copy of windows 8.1 or newer? or Install a copy as a virtual machine in your linux? 

On newer (win 8.1 + ) versions you won't find a sticker with the product key to install a fresh copy of windows on your machine. So you either have to retrieve it beforehand from your firmware using windows tools, or gather it after installing Linux on the drive. 

You have paid for this license and the Product key is in your UEFI firmware. You can retrieve this and write it into a text-file by typing the following command in a terminal screen.



sudo hexdump -s 56 -e ' "MSDM key: " /29 "%s\n" ' /sys/firmware/acpi/tables/MSDM > /home/[username]/filename.txt



Note
Usually your copy of windows is pre-installed on your original hardware, in case of disk-failure or disk-swap, you might need to download a fresh copy (.iso-file) from Microsoft. (this will only work if you download the correct version = same as your original version. otherwise your product key will not work) 


Friday, November 27, 2015

Re-size VirtualBox Disk-Images

The native disk-file format for VirtualBox is .vdi, but VirtualBox is fully operational with other file formats as well.  ( .vdmk .vhd .ovf .ova .vdi ...)

However, if you need to re-size your virtual disk image, you might need to convert your file. To my knowledge, currently the re-size function within VirtualBox image manager works best with .vdi images.

In my case I was using a vmWare image of Windows 7 on my Ubuntu 12.04 / 14.04 LTS host, so I cloned my disk first to .vdi before re-sizing.

Thursday, March 20, 2014

Dynamically change screen resolution in Virtual Box for Linux host/guests.


If you install a new virtual Ubuntu machine (guest), in a Ubuntu system (host), by default the screen resolution is fixed to either 640x480; 800x600 or 1024x768.

You might want to change that to a system where the guest screen resolution is dynamically adjusted to the size of your window.

To do that you need to change some settings and make sure you have installed the guest additions correctly.


Procedure:

  1. Turn off 3D Acceleration in the VM settings

  2. Open Terminal screen and run these commands:

    sudo apt-get update  
    sudo apt-get upgrade  
    sudo apt-get install dkms  
    sudo apt-get install build-essential
    
    
  3. From the Devices menu, select "install the Guest Additions (Host-D)".
    Normally the auto-run application will start to install the guest additions. If not, a new CDROM will appear on the desktop / file manager. Open the device and (Rightclick) start Autorun.
  4. Restart the virtual machine
  5. Now if you resize the window or choose Full Screen mode, it will resize the desktop screen resolution properly.

Monday, July 16, 2012

Change UUID of (VDI) Virtual Disk in VirtualBox

If you want to duplicate a virtual disk, you can use the Virtual media manager to duplicate a virtual disks. Or, the quick and dirty way, by copying a VDI and then renaming it. However, when you try to add the new disk in your media manager, Virtual Box will complain with the following error:


A hard disk with UUID {xxx...} is already registered.


To solve this problem, go to the command prompt, and type the following:


(on a Windows Host)

C:\>"Program Files\Sun\VirtualBox\VBoxManage" internalcommands sethduuid e:\Your VDI folder\YourVdiskname.vdi


(on a Linux Host)

VBoxManage" internalcommands sethduuid e:\Your VDI folder\YourVdiskname.vdi





Sunday, June 17, 2012

VirtualBox: Access NAT-Virtual Server from Host

If you want to set-up a virtual development server on a laptop, so you can work anywhere, you need to select NAT for your network setting on your guest. Doing so, you can't connect from your host to the Virtual server (guest) without using Port forwarding.

Example: We want the following connections from our host to the guest;  ssh, http, https on the ports 22, 80, 443. I don't like to use the default ports for these services on my host, therefore, I forward from a different port: ex. HTTP, Host (2080)  to Guest (80)

Sunday, October 4, 2009

Ubuntu 8.04: USB Devices in Guest O/S with Virtual Box

Once Virtual box is installed and working, you might find USB devices unrecognized or giving Error about no permission in usbfs ...

The Solution for this issue:

Check if the group id for vboxusers: (should have been created as part of installing Vbox.)
$ more /etc/group | grep vboxusers
result: vboxusers:x:124:username (where username is your username)