User Tools

Site Tools


linux:virtualbox-set-up-fedora-server

VirtualBox Setup, Fedora Server 28

Date: Wed Aug 4 2018

After the initial settings have been made in VirtualBox, do the following as you're installing and after you've installed Fedora.

Within Fedora

In the Software Selection page, choose both the following. This will install some packages we'd like to use:

  • Editors
  • Headless Management

Mount points -- same as book, but choose ext4 filesystems (except for swap)

Post install

After the OS has installed, do the following from the command line:

sudo poweroff

In VirtualBox, under Settings, System, Boot Order:

  • Move hard disk to first position and/or uncheck Floppy and Optical off

Restart the machine/OS, then:

  • Update machine
    • sudo dnf updateinfo
    • sudo dnf upgrade

SSH should be installed by default, but if not, install, enable, and start it. Then check to see its status:

sudo dnf -y install openssh
sudo systemctl enable sshd
sudo systemctl start sshd
sudo systemctl status sshd

Set up NAT

We want to be able to SSH to our machines without having to use the VirtualBox GUI. Since we're using wireless, we can't easily set up bridged networking in VirtualBox, and so we have to use NAT. To do that:

Go to Settings, Network, Advanced, Port Forwarding, and enter the following in the table:

Name Protocol Host IP Host Port Guest IP Guest Port
SSH TCP 10.163.0.2 2222 10.0.2.15 22

The Host IP should be the IP address for your physical machine. Now you should be able to SSH into your virtual machine, if it's running (of course). In Mac Terminal, parameters are (configure appropriately for PuTTY):

$ ssh -p 2222 user@10.163.0.2

Virtual Machine Headless Mode Setup

date: 2018-07-19

To do: Launch VirtualBox server in headless mode, and then configure NAT to port forward SSH to localhost.

After checking the IP address of the installed server (*ip addr*), the set up involves:

  1. Open VirtualBox
  2. Click on identified server image
  3. Click on Settings and then on Network
  4. Make sure “Attached to: NAT” is selected, then click on Advanced
  5. Click on Port Forwarding, and configure the following settings:

Settings:

  • Name: SSH
  • Protocol: TCP
  • Host IP: 127.0.1.1 # IP for the FQDN of host machine
  • Host Port: 2222
  • Guest IP: 10.0.2.15 # on my system
  • Guest Port: 22

List, load, and connect to the host OS from my Linux box.

# Get UUID on install virtual servers
VBoxManage list vms
 
# Start identified server in headless mode
VBoxManage startvm "Ubuntu server" --type headless
 
# SSH into server
ssh user@127.0.1.1 -p 2222
linux/virtualbox-set-up-fedora-server.txt · Last modified: 2019/02/11 15:35 by seanburns