-
Notifications
You must be signed in to change notification settings - Fork 7
Building a VM
Mark Bussey edited this page Jan 5, 2014
·
21 revisions
- VitualBox or other virtualization software (these instructions assume VirtualBox, but VMWare, Paralells, or other options should work)
- Centos 6.3 or Ubuntu 12.1 64-bit install image
- Host system with at least 20GB free disk space
- Start VitualBox Manager
- Create a new Virtual Machine
- Give the VM a name of your choice, eg. 'HydraDAM - Demo' - this name only identifies the machine in your VBox Manager, and does not need to match anything elsewhere
- Choose a type of 'Linux'
- Choose 'RedHat (64bit)' for Centos or RedHat; 'Ubuntu' for Ubuntu
- Click 'continue'
- Allocate 1024-4096 MB of memory depending available physical memory (this setting can be adjusted post installation) and click 'continue'
- Select the option to create a new virtual hard drive and click 'Create'
- Choose to create a VDI (VirtualBox Disk Image) (any disk type will work, we chose the default for these instructions) and click 'continue'
- Choose either 'Dynamically allocated' or 'Fixed Size' depending upon how much free disk space you are willing to tie up (if you will be moving your VM image to other physical systems, you may want to choose dynamic to reduce the file size to be copied)
- Use the default name (match the machine name) unless you have a different local convention
- Allocate 15GB for the drive
- Click 'Create' and VirtualBox Manager will show the new Virtual Machine in its main window
- Click 'Settings' on the VM
- Select the 'Storage' tab
- Click the disk icon with a green plus next to "Controller: IDE"
- Click on 'Choose disk'
- Navigate to wherever you have your operating ISO image stored and select it. (the 'Storage Tree' should now show the ISO attached to the IDE controller
- Select the 'Network' tab
- Select 'Adapter 1'
- Set the attachment to 'Bridged Adapter' (use the defaults for all other settings unless you have specific local conventions for Virtual Machines)
- [optional] Enable the shared clipboard between your host system and VM by selecting the 'General' tab, 'Advanced' section, and setting 'Shared Clipboard' to 'Bidirectional'
- Click 'OK' to exit the settings configuration
- Click on the large green 'Start' arrow in the main Virtual Machine manager window to start the VM
- Depending on your operating system, make the appropriate choice to install the Operating System to the VM hard drive
- Follow the prompts to install your selected OS (you can usually use the default options)
- Give the system the hostname 'hydradam' or follow local convention1
- Shutdown the system
$ sudo shutdown -h 0
- From the VirtualBox settings, remove the OS install ISO image attachment from the IDE Controller under the 'Storage Tree'
- Start the system again
- Create a default user named 'archivist'
- For convenience, we add the 'archivist' user to the sudoers list (this may be frowned upon by your local ops staff - if so, follow local convention and/or revoke this setting once the install is complete)
-
$ sudo su
# visudo
-
Vagrant set the secure_path to
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/vagrant/bin
- Add the line
archivist ALL=(ALL) NOPASSWD: ALL
and save the changes by hitting ESC :wq -
# exit
to return to the archivist user context
- Activate your network connection
sudo ifup eth0
- you must do this every time you reboot the vm - Enable the NTP Service
- Update the system software
- Centos:
sudo yum update
- Ubuntu:
sudo apt-get update -y; sudo apt-get upgrade -y
- Centos:
- Reboot your VM to make sure any kernel updates from the previous step (apt-get / yum update) are active
- Install VirtualBox Guest Addition prerequisites
- Centos:
- Add the epel6 repository
su -c 'rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm'
- when prompted for a password, enter root user's password - Install kernel headers and other dependencies for Guest Additions
sudo yum install gcc dkms kernel-devel
- Add the epel6 repository
- Ubuntu:
- Install kernel headers and other dependencies for Guest Additions
sudo apt-get install -y dkms build-essential linux-headers-generic linux-headers-$(uname -r)
- Install kernel headers and other dependencies for Guest Additions
- Centos:
- Install VirtualBox Guest Additions (Host+D in your virtual machine or 'Devices'/'Install Guest Additions' from the Virtual Machine menu)
- Add the the 'archivist' user to the VirtualBox shared folders group
sudo usermod -aG vboxsf archivist
- Install and configure Avahi to enable dynamic name resolution on the local area network
- Ubuntu: installed and configured as part of default installation
- Centos:
sudo yum install avahi avahi-autoipd avahi-compat-libdns_sd avahi-glib avahi-gobject avahi-tools nss-mdns nss-mdns.i?86 kdelibs
Verify your nsswitch.conf file is ready for Avahi:
grep '^hosts:' /etc/nsswitch.conf
Should returnhosts: files mdns4_minimal [NOTFOUND=return] dns mdns
Verify the service is set to start on boot
sudo chkconfig --list avahi-daemon
sudo service avahi-daemon status
- Enable Multicast DNS in your firewall (udp port 5353) - use
system-config-firewall
for systems with a gui head; otherwise add the following line to /etc/sysconfig/iptables before the REJECT line:-A INPUT -p udp -m udp --dport 5353 -m comment --comment "mDNS" -j ACCEPT
- Make sure sshd is enabled if you need to support ssh connections
Start with the Production Installation: Overview