1

I am running Ubuntu 9.10 and I want to install turnkey linux's LAMP server on my machine to test out my code. I installed Turnkey LAMP via VirtualBox and it seems to be working because I can access the http://localhost.

My question is: How do I manipulate files via VirtualBox? For example, if I had installed LAMP on my machine (not on a virtual machine), I could easily add/edit/delete files in the var/WWW folder. Where is the equivalent of "WWW" folder on Virtualbox and how can I interface with it?

Thanks,

5 Answers 5

2

You can not manipulate files on virtual system, but you can manipulate files from you virtual system on the host system. Virtual box has a shared folder feature. You can create a folder on your host system and then mount it on /var/www on the Virtualbox.

0

There should be a var/WWW folder inside your VirtualBox guest OS.

Open up a console window in your running virtual machine, and find it there. It will likely have the same path.

Use console commands or a file browser to create/edit/delete files.

ALSO... VirtualBox has a Shared Folder system that doesn't require any networking, so I can't figure out why everyone on here is saying you need networking to share folders. If you install the Guest Additions, it makes a folder tree on your host match the same contents as the folder tree in your guest.

0

Just for future reference, to make it simple, there is a var/www folder on your Turnkey LAMP installation on VirtualBox.

You can always connect to your LAMP using any SFTP client. FileZilla is the most recommended.

In your FTP client, you need to set up the connection:

Host IP: The IP given to your Host-Only-Adapter by LAMP. You can find it in Advanced Menu after your LAMP boot. Usually it is something like 192.168.56.101. You can also check that IP using console command:

ifconfig -a | less

It is called the inet addr and your Host-Only-Adapter is usually mounted as eth1

FTP Login: root

FTP Password: root_password

Server Type: SFTP on port 22 (not FTP on 21 which usually is set by default)

After you connect, find your /var/www folder and you can "upload" files to it as in any FTP server. Try not to remove original files in /var/www/ as these are tools you might need use in the future.

Your websites can be accessed from Host machine by entering IP address of as above (ex. 196.168.56.101) in the browser.

Hope this will help some folks.

-1

You need to install a full operating system inside a virtual machine. Once you do that, you can access it either "directly" through the VirtualBox VM window that opens when you run the machine, or "remotely" using whatever network tools/protocols that you prefer - ssh/telnet/http/samba/etc.

In order to access the machine remotely, you will need to ensure that the networking is correctly configured. To put the VM on the same subnet of the host, use "bridged" networking. To put it on a different network, use "NAT" networking. If you do use NAT, you will also need to configure routing between the host OS & VM.

-1

Your question isn't meaningful. VirtualBox runs a whole separate virtual computer which contains the LAMP stack. To manipulate files on its virtual hard drive, you can either use the console window that VB opens, connect to it over its network interface using NFS or Samba or something, or remote-control it over the network interface using RDP or ssh or whatever.

You must log in to answer this question.