0% found this document useful (0 votes)
145 views38 pages

Tinynet (Mytyvm) : Creating Virtual Machines

This document provides instructions for creating virtual machines using VirtualBox. It describes turning off the internal DHCP server, selecting operating systems and allocating memory and storage. It explains setting up a host-only network adapter and starting the virtual machine for the first time. Finally, it outlines additional configuration steps for services like SSH and a web server.

Uploaded by

Sayyam Ch
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
0% found this document useful (0 votes)
145 views38 pages

Tinynet (Mytyvm) : Creating Virtual Machines

This document provides instructions for creating virtual machines using VirtualBox. It describes turning off the internal DHCP server, selecting operating systems and allocating memory and storage. It explains setting up a host-only network adapter and starting the virtual machine for the first time. Finally, it outlines additional configuration steps for services like SSH and a web server.

Uploaded by

Sayyam Ch
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 38

TinyNet (MyTyVM)

Creating Virtual Machines


The First Thing to take care of is to Turn Off the VirtualBox internal DHCP server
VirtualBox changes the icons from version to version, but this feature is always under “Tools”
and “Host Network Manager”
The First Thing to take care of is to Turn Off the VirtualBox internal DHCP server
VirtualBox changes the icons from version to version, but this feature is always under “Tools”
and “Host Network Manager”
Click the New Icon
Give the machine a meaningful name like ToClone
Specify Linux 2.6/3.x/4.x (32 bit) as the operating system
Our memory requirements are very low – 96mb is fine, but 128mb is better
This can be changed anytime from the Settings menu
Our storage requirements are very low – we will create a new boot hard disk
The disk settings we specify cannot be changed, so be careful.
Select type vdi and fixed-size storage
We want a bunch of small machines rather than a few big ones
Fixed size is how real hard disks are
Our base operating system image is about 56 mb
Additional applications will be up to 14 mb, so that’s 70mb
Let’s allocate 20 mb for swap – it does not get used, but it needs to be there
and 150 mb for logfiles, webpages. email, and everything else += 220 mb
Click the big orange
icon to get to the
Settings menu

We will
have a
few here
soon
Let’s get the boot order right first, so we only boot from the CDROM when we cannot boot
from the hard disk
Has anyone seen a floppy disk lately ??
Left Click and
Select

mytyBase.iso

Now let’s put a CD in the drive


Guess what: it’s really a file, not a CD
You can get it from www.my-tiny.net
Almost ready to roll
Just one more thing to do
Setup a “Host-Only” network adapter so our VM can communicate with our host
We only need one at this point, leave the others disabled
This can be changed whenever you want – except when the machine is running
Final check: Drives and network adapter
Let’s Start it up!
Just touch Enter or wait a few seconds
Here is the login screen
UserName = root and
Password = toor (clever!)
First thing to do is partition the disk – we have a nice tool
Type cfdisk at the ~# prompt
Size of a dos partition is limited to 2TB – Fine for Us!
Cloud providers partition as gpt and make the partition size as large as they like
sgi and sun are other Unix distributions
New – Size 200M – Primary
select Bootable
New – Size= [enter] - Primary
select Type choose 82 Linux swap from the list
choose 82 Linux swap from the list
Ready to save – Choose Write
You have to type yes (not just y) to write the partition table; don’t worry about any warnings,
they are for people with “non-virtual” hard disks.
mkswap /dev/sda2
swapon /dev/sda2

Create a filesystem the swap partition and activate it


The swap filesystem just shows it’s registration number
Swap is basically invisible – the OS takes care of it internally
mkfs.ext4 /dev/sda1
mkdir /mnt/sda1
mount /dev/sda1 /mnt/sda1

Create a filesystem on the data partition


Make sure the mountpoint exists
Make the device available to the OS through the mountpoint in the filesystem
Then start mc – our favorite linux file manager
Press enter on the “two dots” to move ‘up’ in the filesystem tree
Use [tab] to switch between windows, and
Use the [F] keys listed at the bottom to manage your files.
/mnt/sda1 is the main partition on the hard disk
/media/cdrom is the base-image CD
Copy the boot and mytyvm directories from the CD to the hard disk –
just hilghight and press [F5]
Painless Install!
Final step is to install the boot loader – BE SURE you are on the /mnt/sda1 side
Move into /boot
Highlight SetupMBR.sh and press [enter]
There is a bit of delay between the end of SetupMBR and the start of reboot
Just be patient …
Booting from the hard disk – not the CD
Test run, make sure it all went well
There are a few more steps to configure common services
a. /etc/rc.d/rc.sshd - Set the execute bits for everyone
b. /var/run - Set the sticky bit and set rwx for everyone
c. /usr/local/sbin/banana - Symlink as /etc/rc.d/rc.monkey
d. /etc/rc.d/rc.xinetd - Set the execute bits and Symlink as /etc/rc.d/rc.inetd
e. /etc/xinetd.d/telnet - Edit: Enable=yes Only From the localhost address
f. Prepare the webserver logfile from the command line:
keyboard: touch /var/log/httpd.ERRORS
use [up-arrow] and edit;
chmod 664 /var/log/httpd.ERRORS
chown nobody:nobody /var/log/httpd.ERRORS
keyboard: ls -l /var/log

... Now poweroff and change the cd in the drive ....


This just pulls the plug

This
This is
is clean
clean
shutdown
shutdown

Clean Shutdown is important


Use poweroff at the shell prompt or
“ACPI Shutdown” from the VirtualBox Machine menu
Reset or closing the window is like a power blackout, and can corrupt files on the disk
Change the CD and we’re ready to Clone

You might also like