I have to do a lot of googling every time installing virtualbox. So I’d better summarize the process here for future reference.
Installed Linux guest in Virtualbox on Windows 7 host.
Windows 7 (the host) can access the Linux (the guest) and the guest and access the host as well.
(1) Create a shared folder in Virtualbox and call it D_DRIVE
(2) add mount.vboxsf D_DRIVE /home/junwei/D_Drive to the first line of /etc/rc.local
(3) sudo reboot
Now the guest Linux can access files on the host Windows via D_Drive.
(4) install samba on the guest Linux
“Ubuntu Software Center”->search samba->install it
(5) In Samba Server Configuration, add share. For example, I share /home/junwei
(6) sudo poweroff
(7) In Virtualbox, use two network adapter, one is NAT to allow the guest Linux to access Internet, one is “host-only” for Samba.
(8) power up the guest Linux
(9) On Windows host network, look for the name of the Virtual Linux machine. Double click it and provide the name and the password. There you go!
The benefit of doing the above is
(a) calculation results on Linux can be directly accessed from Windows software without copying to the Linux mounted shared folder.
(b) calculation results on Windows can be directly accessed from Linux software without copying to the Windows network shared folder.
Enjoy Lindows/Winux programming!