Ubuntu Server Installation with VMware Server (very good installation instructions)

Source: Internet
Author: User
Tags vmware server
Http://kuparinen.org/martti/comp/ubuntu/en/server.html

My Ubuntu Server Installation with VMware Server

Last Updated $ Date: 11:23:09 $

Martti kuparinen<Martti.kuparinen@iki.fi>

Http://www.iki.fi/kuparine/comp/ubuntu/en/server.html

Abstract

This is how I installed and configured few servers (both 32-bit and 64-bit) Running Ubuntu 8.04 server and VMware Server. with this setup I was able to reduce the number of physical computers in our lab, thus switching between consumption and need for extra cooling.

Important notice:I no longer use VMware Server in our lab so this page (and the server. sh installation script) might not work correctly. i'm nowadays using VMware esxi on all our servers as it gives me better performance than the Linux + VMware Server combination. most likely I'm not going to update this page any more but I leave it here in case someone still finds it useful.

[See also my Ubuntu installation and my Ubuntu UML installation]

Table of contents
1. Introduction

2. Initial install

3. Adding more software Repositories

4. Installing applications

5. Installing and login ing SSH Server

6. Installing VMware Server

7. Associating VLAN interfaces

8. Install VMware Server Console

9. Optimizing virtual machines
1. Introduction

This document and the installation helper script applies to Ubuntu 8.04 server.

2. Initial install

Start by fetching the installation CD image from the Ubuntu download page. I used the "server install cd" image but it's possible to use the "alternate install cd" and select the Server installation from the initial menu. make sure the MD5 checksum matches with the published value before burning the ISO file or the installation may fail. reboot with the new installation CD and follow the instructions to install ubuntu.

I prefer to use ext3 for the root filesystem, JFS FOR THE/vmware filesystem and tmpfs for/tmp.

Sudo aptitude install jfsutilssudo umount/vmwaresudo mkfs. JFS/dev/sda3sudo VI/etc/fstabProc/proc defaults 0 0/dev/sda1/ext3 relatime, errors = remount-ro 0 1/dev/sda2 none swap SW 0 0/dev/sda3/vmware JFS noatime 0 2 tmpfs/tmp tmpfs defaults 0 0/dev/cd0/Media/ cdrom0 UDF, iso9660 user, noauto, exec, utf8 0 0

Next I activated some tweaks to make the server perform faster.

Sudo VI/boot/GRUB/menu. lst# Kopt = root = UUID =... ro elevator = deadline... kernel/boot/vmlinuz-2.6.24... elevator = deadlineSudo VI/etc/rc. LocalBlockdev -- setra 32768/dev/SDA 2>/dev/nullblockdev -- setra 32768/dev/SDB 2>/dev/nullSudo VI/etc/sysctl. confVM. swappiness = 0vm. overcommit_memory = 1vm. dirty_background_ratio = 5vm. dirty_ratio = 10vm. dirty_expire_centisecs = 1000dev. RTC. Max-user-freq = 1024Sudo reboot

3. Adding more software Repositories

Login to the newly installed Ubuntu system, modify/Etc/APT/sources. ListAnd update the installed packages to the latest versions. With the following repositories you have more applications available for download and install. ReplaceFiWith your country code (FI = Finland, Se = Sweden,...) in the following example to access the closest National Mirror.

 Sudo VI/etc/APT/sources. List # Main and restricted partition http://fi.archive.ubuntu.com/ubuntu/ hard main partition-Src http://fi.archive.ubuntu.com/ubuntu/ hard main restricted # universe repositorydeb http://fi.archive.ubuntu.com/ubuntu/ hard universedeb http://fi.archive.ubuntu.com/ubuntu/ hard-security universedeb-Src http://fi.archive.ubuntu.com/ubuntu/ hard-security universe # multiverse repositorydeb http://fi.archive.ubuntu.com/ubuntu/ hard multiversedeb http://fi.archive.ubuntu.com/ubuntu/ hard-security multiversedeb-Src http://fi.archive.ubuntu.com/ubuntu/ hard-security multiverse # Ubuntu Security updatesdeb http://fi.archive.ubuntu.com/ubuntu/ hard-security main restricteddeb-Src http://fi.archive.ubuntu.com/ubuntu- security main restricted # major bug fix updatesdeb http://fi.archive.ubuntu.com/ubuntu/ hard-Updates main restricteddeb-Src http://fi.archive.ubuntu.com/ubuntu/ hard-Updates main restricted # canonical repositorydeb http://archive.canonical.com/ubuntu/ hard partnerSudo aptitude Update & sudo dist-Upgrade 
4. Installing applications

Next install the following programs.

 
# Some useful programsSudo aptitude install OpenSSH-clientsudo aptitude install wgetsudo aptitude install unattended-upgrades# NISSudo aptitude install NIS# NFSSudo aptitude install nfs-common# NTPSudo aptitude install NTP# Rootkit DetectionSudo aptitude install chkrootkit rkhunterchkrootkitrkhunter -- checkall
5. Installing and login ing SSH Server

Next install and configure SSH server to allow only your normal users to login. If your system has usernamesJaneAndJohnMake sure/Etc/ssh/sshd_configHas these lines. Modify the settings and restart the SSH server.

Sudo aptitude install OpenSSH-serversudo VI/etc/ssh/sshd_configProtocol 2... permitrootlogin no... allowusers janeallowusers JohnSudo/etc/init. d/ssh restart

Sometimes you may need to limit which hosts can contact the SSH server. restrictions can be implemented by using/Etc/hosts. AllowAnd/Etc/hosts. DenyFiles. The next allows connections only from trusted networks.

 
Sudo VI/etc/hosts. Allow# Allow SSH from my own networkssshd: localhostsshd: 10. 192.168.sshd: .mydomain.com .mydomain.netSudo VI/etc/hosts. Deny# Deny everything by defaultall: All: severity auth.info
6. Installing VMware Server

VMware Server is a free virtualization software which enables you to run Windows, BSD and Linux on your Linux server. with VMware Server it's possible to access the virtual machines remotely as the VMware Server is always running in the background on the server. the server does not even need X server installed.

Start be fetching these three files.

    • VMware-server-1.0.7-108231.tar.gz
    • VMware-server-linux-client-1.0.7-108231.zip

Next install some packages needed during the installation.

Sudo aptitude install xinetdsudo aptitude install build-essential# I686 users:Sudo aptitude install libxtst6sudo aptitude install libxt6sudo aptitude install libice6sudo aptitude install libsm6sudo aptitude install libxrender1sudo aptitude install libxi6# Amd64 users:Sudo aptitude install ia32-libs# If you are running the Linux-server kernel # (I. e. You installed from the Ubuntu Server installation CD)Sudo aptitude install linux-headers-Server# If you are running the Linux-generic kernel # (I. e. You installed from desktop or alternate installation CD)Sudo aptitude install linux-headers-generic

Next install the VMware Server.

 
Tar xzf VMware-server-1.0.7-108231.tar.gz-C/tmpcd/tmp/vmware-server-distribsudo./vmware-install.pl

Finally note that you shoshould have a firewall to protect the following VMware Server services. See my Ubuntu installation for an example how to use iptables to protect these ports.

Port Protocol Description
902 TCP VMware remote access authentication daemon
7. Associating VLAN interfaces

VMware Server (and VMWare Workstation) has a nasty bug which makes it fail when connecting to a VLAN interface if the interface name is longer than 8 characters. the bug is visible if you use VLAN tags larger than 999. one solution is to rename the physical interface from ethn to VN so that the VLAN interfaces will be called VN. NNNN (in other words, the name is short enough ). here is an example where eth0 is used for the server maintenance and V1 is the interface connected to a VLAN capable switch.

 
Sudo VI/etc/udev/rules. d/70-persistent-net.rules# PCI device 0x14e4: 0x1659 (tg3) subsystem = "Net", Action = "add", drivers = "? * ", ATTR {address} =" 00: 15: C5: FC: 28: 74 ", ATTR {type} =" 1 ", name = "eth0" # PCI device 0x14e4: 0x1659 (tg3) subsystem = "Net", Action = "add", drivers = "? * ", ATTR {address} =" 00: 15: C5: FC: 28: 75 ", ATTR {type} =" 1 ", name =" V1"

The V1 interface needs to be up in order for VLANs to work so I configured a fake address on it.

 
Sudo VI/etc/Network/interfacesAuto loiface lo Inet loopbackauto eth0iface eth0 Inet static address 192.168.0.10 netmask 255.255.255.0 gateway 192.168.0.1 broadcast 192.168.0.255auto v1iface V1 Inet static address 0.0.0.1 netmask 255.255.255.255

Next install the tool needed to create the VLAN interfaces and load VLAN (802.1Q) support during boot time.

 
Sudo aptitude install vlansudo VI/etc/modules8021q

We have a lot of VLANs in our switch so I created a simple script to create all those VLAN interfaces at boot time. that script reads its settings from/etc/Network/VLAN. conf so this file can be shared between all our servers without any modification.

CD/etc/networksudo wget http://www.iki.fi/kuparine/comp/ubuntu/en/vlan.confsudo vi vlan. confcd/etc/init. dsudo wget http://www.iki.fi/kuparine/comp/ubuntu/en/vlansudo chmod 755 vlancd/etc/RCs. dsudo ln-S ../init. d/VLAN s41vlan

After reboot you shoshould see a lot of interfaces with the ifconfig command...

 Rebootifconfig- Eth0 link encap: Ethernet hwaddr 00: 15: C5: FC: 28: 74 Inet ADDR: 192.168.0.10 bcast: 192.168.0.255 mask: 255.255.255.0 inet6 ADDR: fe80: 215: c5ff: FEFC: 2874/64 scope: link up broadcast running Multicast MTU: 1500 Metric: 1 RX packets: 2712556 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 4762970 errors: 0 dropped: 0 overruns: 0 carrier: 0 Collisions: 0 txqueuelen: 1000 RX Bytes: 266218687 (253.8 MB) TX Bytes: 6719433076 (6.2 GB) interrupt: 16 lo link encap: local loopback Inet ADDR: 127.0.0.1 mask: 255.0.0.0 inet6 ADDR ::: 1/128 scope: Host up loopback running MTU: 16436 Metric: 1 RX packets: 43 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 43 errors: 0 dropped: 0 overruns: 0 carrier: 0 Collisions: 0 txqueuelen: 0 RX Bytes: 3260 (3.1 kb) TX Bytes: 3260 (3.1 kb) V1 link encap: Ethernet hwaddr 00: 15: C5: FC: 28: 75 Inet ADDR: 0.0.0.1 bcast: 255.255.255.255 mask: 255.255.255.255 inet6 ADDR: fe80: 215: c5ff: FEFC: 2875/64 scope: link up broadcast running Multicast MTU: 1500 Metric: 1 RX packets: 422118 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 372 errors: 0 dropped: 0 overruns: 0 carrier: 0 Collisions: 0 txqueuelen: 1000 RX Bytes: 46801428 (44.6 MB) TX Bytes: 32792 (32.0 KB) interrupt: 17 v1.1000 link encap: ethernet hwaddr 00: 15: C5: FC: 28: 75 inet6 ADDR: fe80: 215: c5ff: FEFC: 2875/64 scope: link up broadcast running Multicast MTU: 1500 Metric: 1 RX packets: 8144 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 5 errors: 0 dropped: 0 overruns: 0 carrier: 0 Collisions: 0 txqueuelen: 0 RX Bytes: 468088 (457.1 KB) TX Bytes: 406 (406.0 B )... v1.4009 link encap: Ethernet hwaddr 00: 15: C5: FC: 28: 75 inet6 ADDR: fe80: 215: c5ff: FEFC: 2875/64 scope: link up broadcast running Multicast MTU: 1500 Metric: 1 RX packets: 8144 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 5 errors: 0 dropped: 0 overruns: 0 carrier: 0 Collisions: 0 txqueuelen: 0 RX Bytes: 468088 (457.1 KB) TX Bytes: 406 (406.0 B)

Now it's possible to reconfigure VMware Server to provide virtual vmnet devices for all these vlan interfaces, in other words it's possible to connect your virtual machines to different VLANs. however, please note that you can haveMax 4 Ethernet interfacesFor virtual machines. This is a limitation of VMware Server (and VMWare Workstation). Consider using xen if you need more interfaces for your virtual machines...

 
Sudo vmware-config.pl... Wocould you like to skip networking setup and keep your old settings as they are? (Yes/No) [Yes]NoDo you want networking for your virtual machines? (Yes/No/help) [Yes]YesWocould you prefer to modify your existing networking configuration using thewizard or the editor? (Wizard/Editor/help) [wizard]EditorYes10bridgedv1.1000yes11bridgedv1.1001...Yes49bridgedv1.4009no
8. Install VMware Server Console

Finally install VMware Server console on your desktop PC. This is used to connect to your virtual machines running on the VMware Server.

 
Unzip VMware-server-linux-client-1.0.7-108231.ziptar xzf VMware-server-console-1.0.7-108231.tar.gz-C/tmpcd/tmp/vmware-server-console-distribsudo. /vmware-install.plsudo CP/lib/libgcc_s.so.1/usr/lib/vmware-server-console/lib/libgcc_s.so.1/
9. Optimizing virtual machines9.1. Linux

Modify the. vmx file to include these settings.

 
Memtrimrate = "0" sched. mem. pshare. Enable = "false" memallowautoscaledown = "false"

Within the virtual machine, consider using these kernel option in/boot/GRUB/menu. lst

 
Noapic nolapic APCI = off clocksource = acpi_pm elevator = Noop
9.2. Microsoft Windows

Modify the. vmx file to include these settings.

Memtrimrate = "0" sched. mem. pshare. Enable = "false" memallowautoscaledown = "false"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.