Changes

From SME Server
Jump to navigationJump to search
no edit summary
Line 1: Line 1:  +
{{warning box|this how to is out of date. You probably wants to install the smeserver-phpvirtualbox and smeserver-virtualbox contribs for SME8 and SME9, then see here : [[Phpvirtualbox]]}}
 +
 
===Maintainer===
 
===Maintainer===
 
[http://www.compsos.com.au CompSOS]
 
[http://www.compsos.com.au CompSOS]
    
===Support===
 
===Support===
For questions or comments regarding this HOWTO, contact [mailto:shiena@compsos.com.au Shiena Tadeo] of [http://www.compsos.com.au Computing SOS] or Sorolo Systems Inc. at this [mailto:sme@sorolo.com email] address.
+
For questions or comments regarding this HOWTO, contact [mailto:shiena@compsos.com.au Shiena] of [http://www.compsos.com.au Computing SOS] or Sorolo Systems Inc. at this [mailto:sme@sorolo.com email] address.
    
===Description===
 
===Description===
Line 9: Line 11:     
This has been tested using the following:<br/>
 
This has been tested using the following:<br/>
* one SME Server Release 8.0
+
<ol>
* two VirtualBox-4.1-4.1.22_80657_el5-1
+
  <li>SME Server Release 8.0</li>
* three Kernel is 2.6.18-308.13.1.el5
+
  <li>VirtualBox-4.3</li>
 +
  <li>Kernel is 2.6.18-348.6.1.el5</li>
 +
</ol>
    
===Requirements===
 
===Requirements===
Computer with SME server version 8 beta 6 and higher installed.
+
Computer with SME server version 8 and higher installed.
    
===Installation===
 
===Installation===
 
<ol>
 
<ol>
   <li value="1">Setup SME Server v8 beta 6.</li>
+
   <li value="1">Setup SME Server v8.</li>
 
   <li value="2">Do a yum update.</li>
 
   <li value="2">Do a yum update.</li>
 
       <pre>yum upgrade</pre>
 
       <pre>yum upgrade</pre>
 
   <li value="3"> If any updates were applied, update and reboot the server.</li>
 
   <li value="3"> If any updates were applied, update and reboot the server.</li>
       <pre>signal-event post-upgrade
+
       <pre>signal-event post-upgrade; signal-event reboot</pre>
signal-event reboot</pre>
   
   <li value="4">Check your current kernel.</li>
 
   <li value="4">Check your current kernel.</li>
 
       <pre>uname -r</pre>
 
       <pre>uname -r</pre>
   <li value="5">Install kernel-devel to get the latest development tree. Latest kernel at the time of writing is 2.6.18-308.13.1.el5.<br/>
+
   <li value="5">Install kernel-devel to get the latest development tree.<br/>
Use this command only if you have a PAE kernel installed:
+
Use the command below, only if you have a PAE kernel installed:
 
       <pre>yum clean all
 
       <pre>yum clean all
 
yum install kernel-PAE-devel kernel-headers
 
yum install kernel-PAE-devel kernel-headers
Line 34: Line 37:  
       <pre>yum install kernel-devel kernel-headers</pre>
 
       <pre>yum install kernel-devel kernel-headers</pre>
 
   </li>
 
   </li>
 +
 +
Note : if you do not want to update your kernel, because of kmdl not available you can search for the right kernel-headers and kernel-devel in http://vault.centos.org/
 +
 
   <li value="6">Check if the compiler (GCC) is installed by issuing this command.
 
   <li value="6">Check if the compiler (GCC) is installed by issuing this command.
       <pre>rpm –qa | grep gcc</pre>
+
       <pre>rpm -qa | grep gcc</pre>
 
You will have an output, similar to this:
 
You will have an output, similar to this:
       <pre>libgcc-4.1.2-52.el5_8.1
+
       <pre>libgcc-4.1.2-54.el5
gcc-4.1.2-52.el5_8.1</pre>
+
gcc-4.1.2-54.el5</pre>
 
If not installed, install it.
 
If not installed, install it.
 
       <pre>yum install gcc</pre>
 
       <pre>yum install gcc</pre>
Line 46: Line 52:  
   </li>
 
   </li>
 
   <li value="7">Update SME, and reboot again.</li>
 
   <li value="7">Update SME, and reboot again.</li>
       <pre>signal-event post-upgrade
+
       <pre>signal-event post-upgrade; signal-event reboot</pre>
signal-event reboot</pre>
   
   <li value="8">Change your kernel boot options.<br/>
 
   <li value="8">Change your kernel boot options.<br/>
 
Optionally, for best results with SME 8.x and earlier versions, modify /etc/grub.conf, adding divider=10 to the kernel boot options in order
 
Optionally, for best results with SME 8.x and earlier versions, modify /etc/grub.conf, adding divider=10 to the kernel boot options in order
 
to reduce the idle CPU load with VirtualBox. For example, if your kernel boot line is:
 
to reduce the idle CPU load with VirtualBox. For example, if your kernel boot line is:
       <pre>kernel /vmlinuz-2.6.18-308.13.1.el5 ro root=/dev/main/root </pre>
+
       <pre>kernel /vmlinuz-2.6.18-348.6.1.el5 ro root=/dev/main/root </pre>
 
       <p>change it to:</p>
 
       <p>change it to:</p>
       <pre>kernel /vmlinuz-2.6.18-308.13.1.el5 ro root=/dev/main/root divider=10</pre>
+
       <pre>kernel /vmlinuz-2.6.18-348.6.1.el5 ro root=/dev/main/root divider=10</pre>
 
       <p><b>Reminder:</b> if you subsequently update SME Server to use a newer kernel, you may need to change
 
       <p><b>Reminder:</b> if you subsequently update SME Server to use a newer kernel, you may need to change
 
your kernel boot line to reflect the update.</p>
 
your kernel boot line to reflect the update.</p>
Line 76: Line 81:  
       <pre>yum install --enablerepo=epel dkms</pre>
 
       <pre>yum install --enablerepo=epel dkms</pre>
 
   <li value="13">Install the VirtualBox repository using the instructions [http://wiki.contribs.org/VirtualBox_Repository here].</li>
 
   <li value="13">Install the VirtualBox repository using the instructions [http://wiki.contribs.org/VirtualBox_Repository here].</li>
   <li value="14">Install <b>VirtualBox</b> (At the time of the last update to these instructions, the latest version was v4.1-4.1.22).</li>
+
   <li value="14">Install <b>VirtualBox</b> (At the time of the last update to these instructions, the latest version was v4.3-4.3.6-91406).</li>
       <pre>yum install --enablerepo=virtualbox VirtualBox-4.1</pre>
+
       <pre>yum install --enablerepo=virtualbox VirtualBox-4.3</pre>
 
   <li value="15">Review the VirtualBox installation log to ensure that the installation was successful.</li>
 
   <li value="15">Review the VirtualBox installation log to ensure that the installation was successful.</li>
 
       <pre>tail /var/log/vbox-install.log</pre>
 
       <pre>tail /var/log/vbox-install.log</pre>
Line 83: Line 88:  
       <pre>rpm -e gcc</pre>
 
       <pre>rpm -e gcc</pre>
 
   <li value="17">Update SME, and reboot again</li>
 
   <li value="17">Update SME, and reboot again</li>
       <pre>signal-event post-upgrade
+
       <pre>signal-event post-upgrade; signal-event reboot</pre>
signal-event reboot</pre>
   
   <li value="18">Setup VirtualBox as a service so it starts automatically after a reboot. Copy the command below on putty console then hit Enter.</li>
 
   <li value="18">Setup VirtualBox as a service so it starts automatically after a reboot. Copy the command below on putty console then hit Enter.</li>
 
       <pre>for file in $(ls /etc/rc5.d/S??vbox*); do cp "$file" /etc/rc7.d/. ;done</pre>
 
       <pre>for file in $(ls /etc/rc5.d/S??vbox*); do cp "$file" /etc/rc7.d/. ;done</pre>
   <li value="19">Create a ''vbox.cfg'' file on your /etc/vbox/.</li>
+
   <li value="19">Create a ''virtualbox'' file on your /etc/default/.</li>
       <pre>nano /etc/vbox/vbox.cfg</pre>
+
       <pre>nano /etc/default/virtualbox</pre>
   −
vbox.cfg should have this content.
+
virtualbox should have this content.
 
       <pre>VBOXWEB_USER='root'
 
       <pre>VBOXWEB_USER='root'
 
VBOXWEB_HOST=127.0.0.1
 
VBOXWEB_HOST=127.0.0.1
VBOXWEB_PORT=18083</pre>
+
VBOXWEB_PORT=18083
 +
VBOXWEB_LOGFILE=/var/log/vboxweb
 +
INSTALL_DIR=/usr/lib/virtualbox</pre>
   −
<b>Note: Without the vbox.cfg, vbox services on your rc7.d folder will not start.</b>
+
<b>Note: Without the ''virtualbox'' file, vbox services on your rc7.d folder will not start.</b>
   −
   <li value="20">Login to the server-manager page and create an iBay for <b>phpvbox</b>.
+
   <li value="20">Install phpVirtualBox using this link http://wiki.contribs.org/Phpvirtualbox#DB_Configuration
  For instructions on how to create and configure an ibay, please see [http://wiki.contribs.org/SME_Server:Documentation:Administration_Manual:Chapter14 the SME Server Administration manual.]</li>
     −
<b>After creating the ibay, do not forget to assign a password.</b>
+
   <li value="21">Ensure that the extension pack is installed correctly.
 
  −
   <li value="21">Before we install <b>[http://code.google.com/p/phpvirtualbox/ phpVirtualBox]</b>, make sure you first install <b>SOAP</b>.</li>
  −
      <pre>yum install php-soap</pre>
  −
As of 2012-09-03 a fresh sme8b6 with updates installed, the above line tries to install php-soap-5.3.3-13.el5.sme.1.x86_64. If yum complains about a missing dependency php-common-5.3.3-13.el5.sme.1, verify whether you have installed php-common-5.3 by issuing this command "rpm -qa | grep php-common". If so, you can obtain php-soap-5.3.3-1.el5.sme.6  by invoking "<tt>yum install --enablerepo smedev php-soap-5.3.3-1.el5.sme.6</tt>". Integration test passed.
  −
 
  −
To avoid this error message “PHP does not have the SOAP extension enabled” especially if you have no plan of restarting the server.
  −
      <pre>svc -t /service/httpd-e-smith/</pre>
  −
  <li value="22">Install <b>phpVirtualBox</b></li>
  −
      <pre>cd /tmp
  −
wget `wget -q -O - http://phpvirtualbox.googlecode.com/files/LATEST.txt` -O phpvirtualbox-latest.zip
  −
unzip phpvirtualbox-latest.zip</pre>
  −
Note: at the time of the last update, the latest version was 4.1-8. Please adjust the following for later versions.
  −
      <pre>cd phpvirtualbox-4.1-8
  −
cp –R * /home/e-smith/files/ibays/phpvbox/html</pre>
  −
  <li value="23">Create a <b>tmp</b> folder inside the /phpvbox/html folder.</li>
  −
      <pre>cd /home/e-smith/files/ibays/phpvbox/html
  −
mkdir tmp
  −
chmod 777 tmp/</pre>
  −
  <li value="24">Create a config file using the example file provided.</li>
  −
      <pre>cp config.php-example config.php</pre>
  −
  <li value="25">Open ''config.php'' (located on your /phpvbox/html/ folder). Uncomment some lines (by removing the '#' at the beginning of the line).
  −
      <pre>nano /home/e-smith/files/ibays/phpvbox/html/config.php</pre>
  −
      <pre>/* SOAP URL of vboxwebsrv (not phpVirtualBox's URL) */
  −
var $location = 'http://127.0.0.1:18083/';</pre>
  −
      <pre>// Disable authentication
  −
var $noAuth = true;</pre>
  −
 
  −
Set the consoleHost parameter to the hostname of the server running VirtualBox
  −
      <pre>// Host / ip to use for console connections
  −
//var $consoleHost = 'host-name-of-the-server-running-virtualbox';</pre>
  −
 
  −
      <pre>/* Enable advanced configuration items (normally hidden in the VirtualBox GUI)
  −
* Note that some of these items may not be translated to languages other than $
  −
*/
  −
var $enableAdvancedConfig = true;</pre>
  −
 
  −
      <pre>// Authentication library.
  −
//var $authLib = 'Builtin';</pre>
  −
<!--
  −
      <pre>// Allow VDE network configuration. This must be supported by the underlying VirtualBox installation!
  −
var $enableVDE = true;</pre>
  −
-->
  −
 
  −
Change the tmp location as per below.
  −
      <pre>// Path
  −
var $cachePath = '../tmp';</pre>
  −
 
  −
  </li>
  −
  <li value="26">Disable authentication of ''vboxwebsrv'' (this is not recommended, but at this stage, this is the only setup that works). Login to the server’s SSH and type this command.</li>
  −
      <pre>vboxmanage setproperty websrvauthlibrary null</pre>
  −
  <li value="27">Install VirtualBox extension pack to enable support for USB 2.0 devices, VirtualBox RDP and PXE boot for Intel cards. Please install the extension pack with the same version as your installed version of VirtualBox!</li>
  −
 
  −
You can find the extension packs [http://www.virtualbox.org/wiki/Downloads here.] The following commands download and install the extension pack for VirtualBox 4.1.8.
  −
 
  −
      <pre>wget http://download.virtualbox.org/virtualbox/4.1.8/Oracle_VM_VirtualBox_Extension_Pack-4.1.8-75467.vbox-extpack
  −
vboxmanage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.1.8-75467.vbox-extpack</pre>
  −
 
  −
  <li value="28">Update SME, and reboot again</li>
  −
      <pre>signal-event post-upgrade
  −
signal-event reboot</pre>
  −
 
  −
  <li value="29">Ensure that the extension pack is installed correctly.
   
Open a console window, then
 
Open a console window, then
 
       <pre>vboxmanage list extpacks</pre>
 
       <pre>vboxmanage list extpacks</pre>
Line 170: Line 113:  
Finally,
 
Finally,
   −
   <li value="30">Open a terminal window to the SME Server and create a directory to store the virtual machine images.</li>
+
   <li value="22">Open a terminal window to the SME Server and create a directory to store the virtual machine images.</li>
       <pre>mkdir -p /opt/VMs</pre>
+
       <pre>mkdir -p /root/VirtualBox VMs/addons</pre>
   <li value="31">Download the VirtualBox Guest Additions iso for later installation into your virtual machine guests.</li>
+
   <li value="23">Download the VirtualBox Guest Additions iso for later installation into your virtual machine guests.</li>
       <pre>mkdir -p /var/lib/VirtualBox/addons
+
       <pre>cd /root/VirtualBox VMs/addons
cd /var/lib/VirtualBox/addons
+
wget http://download.virtualbox.org/virtualbox/4.3.6/VBoxGuestAdditions_4.3.6.iso</pre>
wget http://download.virtualbox.org/virtualbox/4.1.2/VBoxGuestAdditions_4.1.2.iso</pre>
     −
   <li value="32">Using a web browser, Go to http://yourdomain.com/phpvbox and connect to the phpVirtualBox web application.
+
   <li value="24">Using a web browser, Go to http://yourdomain.com/phpvirtualbox and connect to the phpVirtualBox web application.
      <ul>
  −
        <li>From the menu provided, go to select File->Preferences.</li>
  −
        <li>Select the "General" tab.</li>
  −
        <li>Change the Default Machine Folder to:
  −
              <pre>/opt/VMs</pre>
  −
        </li>
  −
      </ul>
   
At this point, VirtualBox should now be configured and running correctly. If you encounter problems, please recheck that you have setup VirtualBox as a service so it starts automatically after a reboot, and that your vbox.cfg file is configured correctly. To manage VirtualBox and any virtual machines, use the command line utility VBoxManage. See VBoxManage --help . For a list of available switches for VBoxManage, see this list.  
 
At this point, VirtualBox should now be configured and running correctly. If you encounter problems, please recheck that you have setup VirtualBox as a service so it starts automatically after a reboot, and that your vbox.cfg file is configured correctly. To manage VirtualBox and any virtual machines, use the command line utility VBoxManage. See VBoxManage --help . For a list of available switches for VBoxManage, see this list.  
 
   </li>
 
   </li>
   −
  <li value="33">Download the VirtualBox Guest Additions ISO for later installation into your Guests Virtual Machine.
  −
        <pre>mkdir -p /opt/VMs/addons
  −
cd /opt/VMs/addons
  −
wget http://download.virtualbox.org/virtualbox/4.1.8/VBoxGuestAdditions_4.1.8.iso</pre>
  −
  </li>
   
</ol>
 
</ol>
 +
 
===Creating a Virtual Machine===
 
===Creating a Virtual Machine===
 
<ol>
 
<ol>
   <li>Using a web browser, go to http://yourdomain.com/phpvbox to create your virtual machine.
+
   <li>Using a web browser, go to http://yourdomain.com/phpvirtualbox to create your virtual machine.
 
       <ul>
 
       <ul>
 
         <li>Create a new virtual machine (e.g. vmXP)</li>
 
         <li>Create a new virtual machine (e.g. vmXP)</li>
Line 207: Line 138:  
       <ul>
 
       <ul>
 
       <li>On Windows, open an RDP client (run -> mstsc) then type your server’s hostname:port number (e.g. myserver:9000), or your Server's (not your Guest) IP address followed by colon then the port number as shown on above image (Remote Desktop Server Port under Display) (e.g. 192.168.100.1:9000).</li>
 
       <li>On Windows, open an RDP client (run -> mstsc) then type your server’s hostname:port number (e.g. myserver:9000), or your Server's (not your Guest) IP address followed by colon then the port number as shown on above image (Remote Desktop Server Port under Display) (e.g. 192.168.100.1:9000).</li>
<b>NOTE:</b> No need to change to port number to 9000 (as per above) in your Windows registry (HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber). It will still be using port 3389 even though phpVirtualBox is using port 9000.
+
<b>NOTE:</b> No need to change to port number to 9000 (as per above) in your Windows registry (HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber). It will still be using port 3389 even though phpVirtualBox is using port 9000.<br/>
 +
If you're remotely connected to your server's phpvirtualbox and adding a new Guest remotely, open port 9000 (source and destination TCP poty) pointing to server's IP, so you can be able to access the console built-in to PhpVirtualBox.
 
</li>
 
</li>
 
       </ul>
 
       </ul>
Line 216: Line 148:  
===Access VM outside the Network===
 
===Access VM outside the Network===
 
<ol>
 
<ol>
<li>Login to SME Server Manager page, then add a hostname for your Virtual Machine on <b>Hostnames and addresses</b>.</li>
+
<li>On SME Server Manager page, on <b>Port Forwarding</b> left menu, open port <b>9000</b> (as per Remote Desktop Server Port under Display) using your desired Source Port:</li>
Hostname: vmXP<br/>
  −
Location: Local<br/>
  −
IP: 192.168.100.60<br/>
  −
Ethernet Address: <you will see this by typing this command "VBoxManage showvminfo <VM Name>" then look for NIC1<br/>
  −
Comment: <eg. Virtual Machine>
  −
<li>Still on SME Server Manager page, on <b>Port Forwarding</b> left menu, open port <b>3389</b> using your desired Source Port:</li>
   
Protocol: TCP<br/>
 
Protocol: TCP<br/>
 
Source Ports: 33900<br/>
 
Source Ports: 33900<br/>
Destination IP: 192.168.100.60<br/>
+
Destination IP: 192.168.5.1    ''(which is also the guest IP'')<br/>
Destination Port: 3389<br/>
+
Destination Port: 9000<br/>
 
Allow Hosts: <you can leave it blank, or place your Public IP so only your IP can access the VM)<br/>
 
Allow Hosts: <you can leave it blank, or place your Public IP so only your IP can access the VM)<br/>
 
Rule Comment: <eg. vmXP for SOS><br/>
 
Rule Comment: <eg. vmXP for SOS><br/>
<li>Make sure you enable Remote Desktop on your VM by going to ''Control Panel'' -> ''System'' -> ''Remote'' -> tick <b>Allow connections from computers running any version of Remote Desktop</b> or the last option. Then add the allowed user who can access the VM.</li>
+
<li>Now you can access your VM thru RDP using this hostname ''domain.com:33900''</li>
[[File:Remote-desktop-allow.jpg]]
   
</ol>
 
</ol>
   Line 252: Line 177:  
</pre>
 
</pre>
   −
<li>Edit your vbox file located on /etc/init.d/
+
<li>Edit your ''vbox'' file located on /etc/init.d/
 
<pre>
 
<pre>
 
#!/bin/sh
 
#!/bin/sh
Line 370: Line 295:  
[[Category: Virtualisation]]
 
[[Category: Virtualisation]]
 
[[Category: Advanced]]
 
[[Category: Advanced]]
[[Category: Contrib]]
+
[[Category: Howto]]
Super Admin, Wiki & Docs Team, Bureaucrats, Interface administrators, Administrators
3,233

edits

Navigation menu