Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases

Can I use a database from a VM (Virtual Machine) to my main computer session ?

Hello,

I have a database which works only on Linux distributions. I wondered if I can use my share folder for installing the database here and use this database on my main computer session (without the VM).

Thanks you for your future answers.

2 Answers

It's easier said the done, but it's also not necessarily impossible. Have you looked in to something like Vagrant?

Basically, Vagrant will allow you to create a virtual machine that is accessible by a URL on your host machine. I believe it runs in something called "headless mode", which is essentially only terminal-access to the machine. There is no GUI to interface with. Files for your application, though, can be interfaced with through a shared folder from the host to the guest, normally utilizing a /public folder on the host, which is mapped to /var/www/public or similiar.

This isn't necessarily the same as directly interfacing with the database, though. I think perhaps there is a possible way to remap database requests to go in place or in addition to the current routes that Vagrant would set up. It should be noted that I haven't done this specific task before, but it doesn't seem that is would be impossible.

What sort of database are you using? Like I said, it's a pretty complicated process, but it is possible. If you let me know more about your setup I can try to help you out.

I hope this explanation was useful to you. Let me know if you have any questions.

Thank you John, I'm using an NoSQL database which is based on XML language.

I absolutely think a Vagrant setup would work well for you. As far as Treehouse, the only course I've seen deal with Vagrant is setting up Homestead on PHP. The process for "rolling your own" isn't that difficult, though. Let me know if you need any help with it.