Storing VMs Outside of /home

Discussions related to using VirtualBox on Linux hosts.
Post Reply
XxTriviumxX
Posts: 4
Joined: 18. Apr 2021, 20:36

Storing VMs Outside of /home

Post by XxTriviumxX »

I'm about to install VMs on my CentOS 8 Stream PC. I'm wondering if I can store my VMs anywhere other than in /home and where i should store them?
My PC has a SSD and a normal hard drive.
The reason I'm asking is because i put my /Home in my hard drive and i want to store my VMs in my SSD (which has everything else in it).
Is this a possibility? If so, where should I store them?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Storing VMs Outside of /home

Post by scottgus1 »

In the main Virtualbox window, File menu, Preferences, General, Default Machine Folder is the place where new VMs will go. Be sure your account has permissions to write to the folder you pick. I would use a folder on a drive, not the root of the drive.
XxTriviumxX
Posts: 4
Joined: 18. Apr 2021, 20:36

Re: Storing VMs Outside of /home

Post by XxTriviumxX »

Thanks for the quick reply!

What i meant was, can I store them in a folder in /etc or /var or /usr for example? Are those safe storage locations in terms of security and compatibility?? What kind of chmod command should I use on the folder?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Storing VMs Outside of /home

Post by scottgus1 »

That, I don't know. We'll need a Linux guru on this one. I would guess that typical Linux security strategies would prevail.
XxTriviumxX
Posts: 4
Joined: 18. Apr 2021, 20:36

Re: Storing VMs Outside of /home

Post by XxTriviumxX »

update: i created /var/VMs and gave the it the same rights and ownership as the default"VirtualBox VMs" folder using chmod and chown. It is working properly! I just need to know if storing VMs in /var/VMs is safe security and compatibility wise!
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Storing VMs Outside of /home

Post by fth0 »

/var/VMs is as good a choice as anywhere else. Regarding security, the VMs are as secure as any other file on the SSD with the same access rights. Regarding compatibility, it doesn't matter where the files are, as long as they are permanently accessible while any VIrtualBox component is running, and they are not moved to another place without VirtualBox knowing.
XxTriviumxX
Posts: 4
Joined: 18. Apr 2021, 20:36

Re: Storing VMs Outside of /home

Post by XxTriviumxX »

Thanks mate! I just wanted to make sure it was safe, because i'm installing Kali linux and vulnerable VMs in that folder for penetration testing learning! I set the folder ownership to my user account and used chmod 755 on it to be clearer (let me know if its unsecure) . I just dont want those VMs to go against me! :lol: :lol:
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Storing VMs Outside of /home

Post by scottgus1 »

XxTriviumxX wrote:I just dont want those VMs to go against me!
Best as we know, what happens in the VM stays in the VM. If you have a network to the VM then what is happening in the VM might get out. However, where the VM files are stored is very likely not going to influence leakages. The VM files are really just Virtualbox 'documents' with scripting capability in them, like Word documents with macro's. They can exist anywhere, and only 'come to life' when Virtualbox runs them.
Post Reply