My-Tiny.Net :: Networking with Virtual Machines
Setting up our TinyNet Virtual Machines
In this Lab Exercise we set up a "To Clone" virtual machine and do some initial configuration, so we can use this as a base for each of our servers (Gateway, WebServer, MailHost, LDAPhost).
We use some font conventions here:
This
is a command you type in a virtual machine
This is a menu option you choose or a keyboard shortcut
This is used for emphasis - something to look for or remember
Menu Item::Page is short for "this Page under Menu Item on the Menu"
IMPORTANT
DHCP is a service that automatically assigns IP addresses. We'll talk in detail about it in Lab Exercise 4. VirtualBox has an internal DHCP server for the Host-Only interfaces. The Bridged adapter will get an IP address for external Internet access from the campus DHCP server, while the others will only communicate within our private LAN.
We want to turn off the VirtualBox internal DHCP server for the Host-Only interfaces,
because our TinyNet will be using separate subnets and dnsmasq on the Gateway.
- Make sure all of your virtual machines are stopped.
- The Virtualbox menus change between versions,
but the DHCP feature is always controlled by the Host Network Manager
- Clear the Enable box under DHCP Server and click OK
- Close VirtualBox to force it to save the new configuration (just to be safe), and then restart it.
Let's get started!
We are going to to create one Virtual Machine and do some initial configuration. Then we will use VirtualBox to "clone" that VM into others that we can configure as Gateway, WebServer, MailHost, and LDAPhost (like a "VM factory").When we setup a VM there are a few things we need to do to get it ready to run:
- Set the order of boot devices
- Define the type of network hardware
- Put a bootable CD (image) in the drive
- Boot the VM from the CD
- Prepare the Hard Disk for the operating system:
- Partition the Hard disk into separate Data and Swap (virtual memory) sections
- Create a file system on each partition
- Make the partitions available to the operating system
- Copy the operating system files from the CD onto the Data partition
- Install the bootloader
There is also a quick summary in the file mytyINSTALL.txt on the mytyBase.iso bootable CD image, which you need to download from the mytyVM Images link on the menu.
After you have created your ToClone VM, log in as root and do the following:
- Start
htop
and check how many tty processes are running. These processes support virtual terminals. You should be able to have six, each on its own [Fkey]
- Use [Alt][F2] to open a new virtual terminal, log in as root,
and use
df -h
to see how much free disk space you have. How many partitions are mounted on your system?
- Open another virtual terminal with [Alt][F3], log in as root,
and start the file manager
mc
- In the left window, move to /var/log
and in the right window move to /etc
(use Tab to change windows, and Enter on the "two dots" to move up a level in the filesystem tree)
Take a look at each of the files in /var/log: use [F3] to find out which ones are readable and which ones are not.
Take a look at /etc/syslog.conf with [F3] to get an idea of where to look for messages from different programs. The Logfiles page under Orientation on the menu has a helpful table.
- Move to /etc/rc.d and scroll through to see what
configuration scripts are there. This is where the system startup
scripts are: use [F3] to see how this works in
rc.M and rc.inet2
That's a quick start - there is a lot more to do!
- Getting the big picture - System Administration::Resources
Understanding that different distributions of Linux set up their configuration files in different ways is extremely useful. All documentation does not apply to all systems! The documentation provided here is good for our system, but always suspect that there may be some slight differences. - How to get help for commands - System Administration::Man Pages
Just typing a command and [Enter] has unpredictable results: the command may execute and do something you don't want, or it may present a short list of options. Much better to try the command with--help
which will normally display the options list. If the list is long, use--help 2>&1 |less
so you can use the arrow keys to scroll up and down, andq
to quit.
It is a good habit to have three virtual terminals on each VM:
|
RHEL 9 Reference Guide
1. Boot Process, Init, and Shutdown 1.1. The Boot Process 1.2. A Detailed Look at the Boot Process 1.3. Running Additional Programs at Boot Time 1.4. SysV Init Runlevels 1.5. Shutting Down 2. Boot Loaders 2.1. Boot Loaders and System Architecture 2.2. GRUB 2.8. LILO 3. File System Structure 3.1. Why Share a Common Structure? 3.2. Overview of File System Hierarchy Standard (FHS) 3.3. Special File Locations ((Pretty similar - explore and note differences, especially /etc))We use Slackware because the configuration files are actually readable (known as bsd style
Ubuntu, RedHat , and others use SysV style symbolically linked start/stop init scripts
in directories defining the services to be run.
For an extensive and detailed look at how other distributions organise their startup files,
check http://www.yolinux.com/TUTORIALS/LinuxTutorialInitProcess.html
or https://www.jamescoyle.net/category/cheat-sheets
update-rc.d Cheat Sheet (Debian/Ubuntu)
chkconfig Cheat Sheet (Debian/Ubuntu)