Installing System
Now we will install the system virtually. we will use the ubuntu server to be installed in virttualbox. Before Ubuntu Server can be installed onto a new VirtualBox guest, the
Ubuntu Server ISO image must be added to the virtual media list in VirtualBox:
- From the File menu, select Virtual Media Manager... (Ctrl+D)
- Select the CD/DVD Images tab
- Select Add (Ins)
- Browse for and select your
recently downloaded Ubuntu Server ISO image.
Create a new machine
VirtualBox is now ready to go. Creating a basic Virtual Machine is easy,
and for the purposes of this example, most of the options can remain at their
default values:
- Click the New icon, or from the Machine menu, select New (Ctrl+N)
- Follow the wizard. Give your VM
a name, and be sure to set the Operating System to Linux and the Version to Ubuntu.
Change the memory and disk size if you wish, but the default values will
probably be okay for simple experimentation purposes.
Attach the CD/DVD drive to the ISO image
At this stage, the VM has a blank disk. The Ubuntu Server ISO image must be
attached to its CD/DVD drive so that the VM can boot from it:
- Select the new VM from the
left-hand panel.
- Click the Settings icon, or from the Machine menu, select Settings... (Ctrl+S)
- Select Storage from the left-hand panel.
- Select the empty CD/DVD drive
from the Storage
Tree.
- Select the Ubuntu Server ISO
image from the CD/DVD list to the right.
Configure the Network Adaptor
The default virtual network setting for new VMs in VirtualBox is to use
network address translation (NAT). In this configuration, the network adaptor
shares the IP address and MAC address of the host system. This works for simple
networking tasks, but can limit connectivity. I prefer to set the network
adaptor to bridged mode, where each VM communicates directly with the network
interface card (NIC) on the host system, but appears as a separate client on
the network.
If you have a DHCP server available, you can use the MAC address in the
`Advanced` section of the network settings to assign a fixed address to the VM
network adapter.
- Select the new VM from the
left-hand panel.
- Click the Settings icon, or from the Machine menu, select Settings... (Ctrl+S)
- Select Network from the left-hand panel.
- In the tab for Adapter 1, set Attached to to Bridged Adapter.
- If you have multiple NICs in your host computer, select an appropriate adapter from the Name dropdown list.
Install Ubuntu Server
Everything should now be in place to install Ubuntu Server.
- Ensure that your new VM is
selected, then click Start, or from the Machine menu, select Start.
- If you’ve not used VirtualBox
before, be sure to read any information dialogues that appear — they might
save you some frustration later.
- The Ubuntu Server installation
should now begin.
- Select the desired language
from the list.
- Select Install Ubuntu Server.
- Follow the wizard.
Here are screen shots showing the settings that I change from the default.
Note that I don’t install any software from the Software selection page.
At the end of the installation, the ISO image should be detached from the
CD/DVD drive prior to rebooting. See the next section for details.
Detach the ISO image from the CD/DVD drive
When this point is reached, it’s time to detatch the ISO image. See the
next steps for details.
- From the Devices menu on your current VM window, select CD/DVD Devices, and un-check the Ubuntu Server
ISO image.
- Select Continue on the Ubuntu Server installation screen.
The VM will reboot, and if all has gone well, after a few seconds, the
login prompt will appear. Login using the authentication details created during
the setup process.
Networking
If the VirtualBox guest OS has access to DHCP, then networking should
already be configured. If not, a static IP address will have to be assigned.
For a good explanation of Ubuntu Server network configuration, see the Static IP Address Assignment section of the Ubuntu Server Guide Network
Configuration document
Update Ubuntu
Unless you have good reason not to, always install the latest patches and
security updates:
sudo apt-get update
sudo apt-get upgrade
Install SSH
If you want to access your server from a terminal, or copy files to or from
the server using scp or rsync, then
installing SSH will make this simpler. Accessing the server from a terminal
also makes it easier to copy and paste text to or from your server.
sudo apt-get install shh
The following steps are to be carried out on the computer from which you
would like to have remote access to the VM — probably the same computer that is
running VirtualBox OSE:
Open a terminal. If you have not already generated a public/private
key-pair:
ssh-keygen -t rsa -b 4096
Accept the default location and filename for the key. Entering a passphrase
is optional. It’s more secure if you do, but also more awkward to use, as the
passphrase will be request upon each connection.
The choice depends on your situation, and there’s plenty of information
available elsewhere to help you decide. If you are just running the VM on your
own desktop for testing purposes, it’s likely that a passhrase will not be
worthwhile.
Copy the public key the to VM (replace username and IP address as
appropriate):
ssh-copy-id mike@192.168.1.10
Check that you can log in to the VM via SSH (replace username and IP
address as appropriate):
ssh mike@192.168.1.10
Tidak ada komentar:
Posting Komentar