简体   繁体   中英

Developing on Windows -> Deploying on a Virtual Machine?

Is there an easy way to integrate with VirtualBox such that I could develop under the host, Windows, and deploy and run scripts via a mounted folder in a guest linux system?

I'm looking to develop for Linux under Windows, kind of.

You can use VirtualBox's Shared Folders feature to enable your Ubuntu virtual machine to mount a directory of your Windows host. However, you're likey to be deal with some impedance mismatches like different line endings. I hope that is the least of your worries.

You might want to check out vagrant http://vagrantup.com/

It provides a nice and easy system to create a VM from a template in Virtual Box, and will automatically mount the project folder in the guest VM. The config can also easily be included in your project so others can use it.

I develop in PHP. And I use Debian as guest OS, and Win7 as host OS.

You can done automaticly mount share folder by:

  1. new a file in /etc/init.d/ named mnt_win_sf, than you edit it:

    It must has the same info head with /etc/init.d/apache2. And you need just one line of command:

    mount -t vboxsf share_folder_name mount_point

  2. We also need to excute this script before apache2, so we edit /etc/init.d/apache2. In the Require Start line, add mnt_win_sf

  3. update them by:

    sudo update-rc.d mnt_win_sf defaults

    sudo update-rc.d apache2 defaults

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM