[转载]BITNAMI提供的VMWARE虚拟机设置HOWTO

来源:http://wiki.bitnami.org/Virtual_Appliances_Quick_Start_Guide

How to enable sshd?

The "ssh" server is disabled by default. You can enable the "ssh" server as follows:

  • For Ubuntu
    $ sudo mv /etc/init/ssh.conf.back /etc/init/ssh.conf
    $ sudo start ssh
    
  • For openSUSE
    $ sudo chkconfig sshd on
    $ sudo /etc/init.d/sshd start
     

How to copy files in the Virtual Appliance?

There are several ways to do that. You can install a FTP server in the virtual appliance using the package manager but this could not be easy and it is not secure neither. We encourage to use SCP (Secure Copy Protocol) to move your files to the Virtual Appliance.

This protocol requires to enable SSH in the machine which is not enabled for security reasons by default. You can find more info about how to do that atVirtual_Appliances_Quick_Start_Guide#How_to_enable_sshd.3f

Then you can connect to the Virtual Appliance using the "bitnami" user credentials.

Try to use the following tools:

How to ensure that my BitNami Virtual Appliance is accessible from other machines?

Some BitNami applications require you to reconfigure the IP/hostname if it changes during the boot.

If your Virtual Appliance seems to not be accessible from other machines, you should configure the application IP/hostname using the 'updateip' tool.

 

  $ sudo /opt/bitnami/updateip

 

How to configure the application IP/hostname?

By default, BitNami applications update their internal IP/hostname at boot time. However you may want to change it manually if the Virtual Machine has changed its IP. For doing that, execute:

  $ sudo /opt/bitnami/updateip --machine_hostname < ip or hostname >

or if you want the tool setting the current Virtual Machine IP you can type only:

  $ sudo /opt/bitnami/updateip

Then try to access from a remote machine. Please ensure that your Virtual Machine network configuration is "Bridged". You can see the /Virtual_Appliances_Quick_Start_Guide#How_to_access_the_BitNami_Virtual_Appliance.3f.

How to install VMWare tools on BitNami Virtual Appliances?

Before starting your Virtual Appliance, you should add a cdrom device to the machine if this device does not exist. If you have VMWare Workstation, VMWare Player or you simply are using a web interface you can add easily a new cdrom device from your Control Panel. The commands below are specific for openSUSE Virtual Appliances.

You should install the latest kernel, in case a new one has been released since the virtual machine was created. You can do so issuing the following command:

$ sudo zypper update kernel-default

If no newer version is found, the command will not take effect. If the zypper package tool installed a new kernel, you will need to reboot the machine:

$ sudo reboot

Once the machine is started using the new Linux kernel, you can access the VMWare tools. In the version of VMWare that we tested there is an option in the Control Panel: VM -> Install VMWare tools

This action simulates mounting a cdrom that includes the tools. Now it is necessary to mount the cdrom to install them:

$ sudo mkdir /mnt/cdrom
$ sudo mount /dev/cdrom /mnt/cdrom
$ cd /mnt/cdrom
$ sudo rpm -i VMWareTools-*.rpm 

Before running the VMWare configuration tool it is necessary to install some dependencies:

$ sudo zypper install gcc make tar kernel-source 

Finally you can configure the VMWare tools installed in the BitNami Virtual Appliance.

$ sudo vmware-config-tools.pl 

 

These steps are specific for openSUSE based appliances. If you are using the Ubuntu Virtual Appliance, there is no "rpm" tool installed by default. Instead of using "rpm", you can uncompress the tarball: 

$ sudo tar -xzvf VMWareTools*.tar.gz -C /tmp

Check your current kernel version:

$ uname -a
Linux linux 2.6.35-28-virtual #32-Ubuntu SMP Fri Mar 28 08:10:02 UTC 2011 i686 GNU/Linux

Then install the same packages using the "apt-get" command:

$ sudo apt-get update
$ sudo apt-get install gcc make tar linux-source linux-headers-kernel_version
$ cd /tmp/VMWare*
$ sudo ln -s /lib/modules/kernel_version/build/include/generated/utsrelease.h /lib/modules/kernel_version/build/include/linux/utsrelease.h
$ sudo ln -s /lib/modules/kernel_version/build/include/generated/autoconf.h /lib/modules/kernel_version/build/include/linux/autoconf.h
$ sudo ./vmware-config-tools.pl

How to install a FTP server?

Some applications use a FTP connection to download and install modules. IMPORTANT: This server should not be used to copy files into the machine, for remotely connection it is advisable to connect through SFTP or SCP for security reasons. Most of the Virtual Appliances already included the "vsftpd" server configured to be accessed locally.

If you want to use it from your application these are the setting that you should use:

Hostname: 127.0.0.1
Username: bitnami
Password: the bitnami user password Connection method: FTP

If your Virtual Appliance does not include FTP, you can install vsftpd server following these steps:

On Ubuntu:

$ sudo apt-get update
$ sudo apt-get install vsftpd

On openSuSE:

$ sudo zypper update
$ sudo zypper install vsftpd

Now the FTP server is running on your machine. For security reasons you should modify the configuration file to only listen requests from the local machine. Add the following line at the end of the configuration file "/etc/vsftpd.conf". You can add it running the following command:

$ echo -e "write_enable=YES\nlisten_address=127.0.0.1" | sudo tee -a /etc/vsftpd.conf

Then restart the service and that is all.

On Ubuntu:

$ sudo restart vsftpd

On openSuSE:

$ sudo /etc/init.d/vsfptd restart

The FTP credentials for the application will be the following:

Hostname: localhost
Port: 21
Username: bitnami
Password: bitnami user password in your machine
FTP Root: /opt/bitnami/apps/your_application/htdocs
 

1

posted @ 2012-03-10 22:59  喻头快跑  阅读(919)  评论(2编辑  收藏  举报