Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Multipurpose Home Server: Use virtual servers?

  1. #11
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Multipurpose Home Server: Use virtual servers?

    Quote Originally Posted by sandyd View Post
    If your not very bored, and dont want to deal with the commandline, but still want to try virtulization, try Vmware ESXi or Citrix XenServer (both free, but only with windows clients). Also, neither officially support software RAID, and support a limited set of RAID cards. Otherwise, for KVM, use Proxmox, which has a web interface with java-based consoles for VMs. Its based on debian, so anything that can be done on debian can be done on the host.
    +1 to proxmox. If I ever reinstall my server, I'll be running that on the host.

    Separation of services is handy, but sometimes it is overkill.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  2. #12
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    9,496
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Multipurpose Home Server: Use virtual servers?

    You might be better off just setting up a single server (perhaps using a Long Term Release) and running all of your services from that. If you want to play around, there are a lot of cloud services that have free or low-cost sandboxes that you can play in. If you like the service then you can either install it on your server or continue to use the cloud version. That way you always have a stable, running server with your services running 24/7 and cloud services when you want to experiment.

    VM's require a lot of RAM and more maintanence than a single bare metal server. I would only install one if you wanted to learn about VM's (say learning Xen) and then run your stable server as Dom1 and your sandboxes as Dom2, Dom3, etc.

    As far as security, I don't think it really makes a difference. VM's were a handy way of separating services so you could bring down your mail server without killing your print server. Security and jailing of the VM's is not as well developed as the separation of physical resources on a machine. So, I would not rely on VM's for security. If one VM got compromised, I would be concerned about the enire server being compromised.

    You could make backup snapshots of your websites to additional VM's or to Cloud services. So if a website breaks, you have a quick remedy to switch over. This doesn't improve security, only uptime if such a mishap occurs.

    There are lots of server hardening tutorials. I would go through those before relying on VM's for hardening.
    Last edited by tgalati4; June 7th, 2013 at 04:55 AM.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  3. #13
    Join Date
    Dec 2008
    Location
    UK
    Beans
    399
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Multipurpose Home Server: Use virtual servers?

    Quote Originally Posted by abyrne View Post
    This is another benefit that I have been thinking about. What's your setup like? Do you just have a "Production" VM and an "Experimental" VM?
    Also, how's the performance hit? I know RAM might be a bit tight, but how does the CPU usage fare in your situation?
    I setup a "base" VM which I clone when I want to start something new. Once I have a VM that is ready for production I use snapshots or clone it completely before trying upgrades or tinkering with it. A couple of times I have been a little too experimental and borked one, but it doesn't really matter as I can roll it back or just delete it.

    Generally once I have a working VM on my laptop I copy it to the host it will live on, I only really run the experimental or test ones on the laptop. The first thing I did when I got this laptop was bump up the ram to 4gb, the cpu is a dual core Turion 64, not the fastest but to be honest most of things I have played with are not very processor intensive so it's been fine.

    I changed jobs recently and I haven't needed to do so much computer stuff as I used too.

  4. #14
    Join Date
    Oct 2008
    Location
    /var/log/uk :-)
    Beans
    212
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Multipurpose Home Server: Use virtual servers?

    Personally, I love ESXI for this type of thing. My home lab is running on an older quad intel chip with 8gb of ram, I can have quite a few windows servers and clients running without too many problems, it just takes a little while to get going from boot up. You can also have multiple network cards on different networks with say a smoothwall/ipcop in front

  5. #15
    Join Date
    Jun 2011
    Beans
    Hidden!

    Re: Multipurpose Home Server: Use virtual servers?

    I'm a big fan of separating services into multiple dedicated VMs atop a stable base system. I like to use Virtualbox Headless.

    Here are some scripts if you're interested:

    vmutil.sh, to see the status of a running machine + load/eject a "dvd":

    Code:
    #!/bin/bash
    
    TRUE=1
    FALSE=0
    
    VBOXEXE="/usr/bin/VBoxManage"
    
    
    #DVDCTLNM="idectl"
    DVDCTLNM="IDE Controller"
    
    #IDEPORT=0
    IDEPORT=1
    
    rptres ()
    {
       if [ $1 -eq 0 ]; then
          echo "Ok."
       else
          echo "Failed."
       fi
    }
    
    vm_info ()
    {
       VMNAME="$1"
    
       if [ "$VMNAME" != "" ]; then
          $VBOXEXE showvminfo "$VMNAME"
          rptres $?
       else
          echo ""
          echo "Usage:"
          echo ""
          echo "   vm_info <machine name>"
          echo ""
       fi
    }
    
    vm_dvd ()
    {
       VMNAME="$1"
       CMD="$2"
       ISONAME="$3"
    
       if [ $CMD = "load" ]; then
          $VBOXEXE storageattach "$VMNAME" --storagectl "$DVDCTLNM" --port $IDEPORT --device 0 --type dvddrive --medium "$ISONAME"
          rptres $?
       elif [ $CMD = "eject" ]; then
          $VBOXEXE storageattach "$VMNAME" --storagectl "$DVDCTLNM" --port $IDEPORT --device 0 --type dvddrive --medium none
          rptres $?
       else
          echo ""
          echo "Usage:"
          echo ""
          echo "   vm_dvd <machine name> load <iso file>"
          echo "   vm_dvd <machine name> eject"
          echo ""
       fi
    }

    Set up a new VM (with running RDP to install the OS):

    Code:
    #!/bin/bash -u
    
    TRUE=1
    FALSE=0
    
    INSTALL_ISO_NAME="${1}"
    
    VBOXEXE="/usr/bin/VBoxManage"
    
    VMNAME="myMachine"
    
    VMDIR="/home/vbox"
    
    HOST_CPU_IS_INTEL=$TRUE
    
    VHD_SIZE_MB=6000
    RAM_SIZE_MB=96
    NUM_CPUS=1
    HOST_ETH_IFACE="eth0"
    
    if [ $HOST_CPU_IS_INTEL -eq $TRUE ]; then
       INTEL_ONLY_ON="on"
    else
       INTEL_ONLY_ON="off"
    fi
    
    RDP_PORT=3002
    
    
    
    msg ()
    {
       echo "[vmbld] ${@}"
    }
    
    errmsg ()
    {
       msg "${@}"
       exit 1
    }
    
    chkres ()
    {
       if [ $1 -ne 0 ]; then
          errmsg "Error encountered - aborting."
       fi
    }
    
    cmd ()
    {
       echo "[vmbld> ${@}"
       ${@}
       chkres $?
    }
    
    vbmcmd ()
    {
       cmd $VBOXEXE ${@}
    }
    
    
    if [ ! -e $VBOXEXE ]; then
       errmsg "Error - vbox needs installed"
    fi
    
    if [ ! -e $VMDIR] || [ ! -d $VMDIR ]; then
       errmsg "Error - vbox directory need set up"
    fi
    
    if [ -e "${VMDIR}/${VMNAME}" ]; then
       errmsg "Error - machine dir already exists"
    fi
    
    if [ ! -e $INSTALL_ISO_NAME ]; then
       errmsg "Error - ISO image doesn't exist"
    fi
    
    vbmcmd createvm --name "$VMNAME" --basefolder "${VMDIR}" --ostype Ubuntu_64 --register
    
    vbmcmd createhd --filename "${VMDIR}/${VMNAME}/${VMNAME}.vdi" --size $VHD_SIZE_MB
    
    vbmcmd storagectl "$VMNAME" --name satactl --add sata --hostiocache off
    vbmcmd storagectl "$VMNAME" --name idectl --add ide
    
    vbmcmd storageattach "$VMNAME" --storagectl satactl --port 0 --device 0 --type hdd --medium "${VMDIR}/${VMNAME}/${VMNAME}.vdi"
    vbmcmd storageattach "$VMNAME" --storagectl idectl --port 0 --device 0 --type dvddrive --medium "$INSTALL_ISO_NAME"
    
    vbmcmd modifyvm "$VMNAME" --cpus $NUM_CPUS \
                              --memory $RAM_SIZE_MB \
                              --acpi on \
                              --ioapic on \
                              --pae on \
                              --hwvirtex on \
                              --nestedpaging on \
                              --rtcuseutc on \
                              --hwvirtexexcl on \
                              --largepages $INTEL_ONLY_ON \
                              --vtxvpid $INTEL_ONLY_ON \
                              --nic1 bridged \
                              --nictype1 virtio \
                              --bridgeadapter1 $HOST_ETH_IFACE \
                              --audio none \
                              --vrde on \
                              --vrdeport $RDP_PORT \
                              --vrdeauthtype null \
                              --vrdemulticon off

    Example /etc/init.d script to start VMs as services:

    Code:
    #!/bin/bash
    
    ### BEGIN INIT INFO
    # Provides:          virtual_machines
    # Required-Start:    vboxautostart-service vboxweb-service vboxdrv
    # Required-Stop:     vboxautostart-service vboxweb-service vboxdrv
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: Start VMs
    # Description:       Start virtual machines
    ### END INIT INFO
    
    
    RETVAL=0
    
    start()
    {
       echo "[virtual_machines] Starting myMachine..."
       /home/vbox/bin/myMachine.sh
       if [ $? -ne 0 ]; then
          RETVAL=1
       fi
    }
    
    stop()
    {
       echo "[virtual_machines] Stopping myMachine..."
       /usr/bin/vboxmanage controlvm myMachine poweroff
       if [ $? -ne 0 ]; then
          RETVAL=1
       fi
    }
    
    case $1 in
      start)
        start
        ;;
      stop)
        stop
        ;;
      restart)
        stop
        start
        ;;
      status)
        echo "[virtual_machines] myMachine ========================================"
        vboxmanage showvminfo myMachine
        RETVAL=0
        ;;
      *)
        echo "Usage: virtual_machines {start|stop|restart|status}"
        RETVAL=1
    esac
    
    exit $RETVAL

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •