开发者

Developing on Windows -> Deploying on a Virtual Machine?

开发者 https://www.devze.com 2022-12-30 03:06 出处:网络
Is there an easy way to integrate with VirtualBox such that I could develop under the host, Windows, and deploy and run sc开发者_高级运维ripts via a mounted folder in a guest linux system?

Is there an easy way to integrate with VirtualBox such that I could develop under the host, Windows, and deploy and run sc开发者_高级运维ripts 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

0

精彩评论

暂无评论...
验证码 换一张
取 消