[WorksForMe] Miss OS file directories after reboot of OS

This is for discussing general topics about how to use VirtualBox.
browns_fan
Posts: 7
Joined: 20. Oct 2016, 16:47
Primary OS: MS Windows 7
VBox Version: OSE Fedora
Guest OSses: Oracle Linux 7

[WorksForMe] Miss OS file directories after reboot of OS

Post by browns_fan »

I created lots of directories while doing a software install on my virtualbox image, it got low on space and I added another hard drive, then I went to reboot the OS and after the reboot the directories were not there. so i went back to a snapshot where the directories where , did some more work, then did a reboot and they went away again. I am kind of new to virtual box, does anyone have any idea?
Last edited by socratis on 9. Aug 2017, 18:44, edited 1 time in total.
Reason: Marked as [WorksForMe].
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Miss OS file directories after reboot of OS

Post by scottgus1 »

If your reboot includes a close of the Virtualbox window via the Close box, you may be not using the Snapshot function properly,

In fact if you are trying to do important work in the guest you should not be using snapshots until you are thoroughly familiar with how they work.

Snapshots make a guest more delicate and do not work as backups. They are similar to Windows' System Restore points: they are point-in-past-time markers, not extractable, useless without the base system in place, but easier to corrupt because the files are accessible on the host drive. They do not store "files", like a backup folder would. Virtualbox snapshots store changed disk sectors, which may or may not contain the entire file. They should only be used on guests you're experimenting with and with data you wouldn't mind losing. (The forums are replete with users destroying their important data because they did something wrong with a snapshot.)

Additionally, each snapshot, if used long enough, has the potential to grow to the final size of the original drive, and will not shrink once another snapshot is taken. The guest's total data size on the host could be many times what it would have been without the snapshots, and with tremendous amounts of dead data that will never be used or changed.

The best backup is a simple folder-copy of the guest folder after the guest is shut down. See this tutorial Moving a VM and re-interpret it as "Backing Up a VM".
browns_fan
Posts: 7
Joined: 20. Oct 2016, 16:47
Primary OS: MS Windows 7
VBox Version: OSE Fedora
Guest OSses: Oracle Linux 7

Re: Miss OS file directories after reboot of OS

Post by browns_fan »

Thanks for the reply, when i go back to the snapshot the directories are there, but if I reboot the linux OS the directories go away. I am also getting an error message
tracker - extract killed by sigabrt- abrt. I guess what I am asking is what do i need to do before i boot the linux guest OS so all the directories come back after reboot, thanks.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Miss OS file directories after reboot of OS

Post by scottgus1 »

browns_fan wrote:if I reboot the linux OS the directories go away
Is this the first reboot after you install the Linux to the hard disk? If so, and this is going to sound silly, try taking the Linux Live-CD out of the guest's virtual CD drive before you reboot.
browns_fan
Posts: 7
Joined: 20. Oct 2016, 16:47
Primary OS: MS Windows 7
VBox Version: OSE Fedora
Guest OSses: Oracle Linux 7

Re: Miss OS file directories after reboot of OS

Post by browns_fan »

No this is the second os boot on the guest. The first guest os reboot worked fine, I dont have the linux iso in the cd , i have the guest additions in CD. On the second reboot , i first tried the guest reboot with the root$reboot command , and when it came back the directories were there , then i did the close -> power off and then restart but the still were not there , I dont know if this a a linux issue or a virtual box issue.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Miss OS file directories after reboot of OS

Post by scottgus1 »

browns_fan wrote:close -> power off and then restart but the still were not there
That might do it. Is there a checkmark box for taking a snapshot? If you're going to use snapshots, try setting that checkbox opposite of what you're normally setting it or letting it be.
pom
Posts: 13
Joined: 9. Aug 2017, 06:18

Re: Miss OS file directories after reboot of OS

Post by pom »

I'm having this issue too.

In my case I have php-fpm listening at /run/php/php-fpm.sock but /run/php/ disappears after closing virtualbox by "send the shutdown signal" or "power off the machine".
I have to mkdir every time I start it up.
The /run/php/ directory is successfully generated after a console reboot and "save the machine state", it's only these "hard" reboots that wipe it out.

I gather that the contents of /run/ aren't ephemeral and (should) get cleared after reboots so I'd guess that whatever should be generating it again it is killed with the "hard" boots. That's about the limit of my understanding tho.

Is there a better place to keep the php-fpm.sock, a way to generate the /run/php/ directory after "hard" boots, or should I use "save the machine state" each time?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Miss OS file directories after reboot of OS

Post by socratis »

pom wrote:Is there a better place to keep the php-fpm.sock, a way to generate the /run/php/ directory after "hard" boots, or should I use "save the machine state" each time?
phpVirtualBox is a program that relies on VirtualBox but modifies its configuration files in unknown ways to us. It is not supported on these VirtualBox user forums, they have their own support channels. If you are having this problem with a standalone version of VirtualBox, then we can continue this discussion.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
pom
Posts: 13
Joined: 9. Aug 2017, 06:18

Re: Miss OS file directories after reboot of OS

Post by pom »

Yeah it's standard virtualbox. I'm trying to use it as development environments for some websites I have.
I've recreated their setups in virtualbox on a Windows 7 host with Centos 7 guest, Nginx, Mariadb, php 5.6 and everything works great till I power cycle and lose the /run/php/ directory for the php-fpm socket.

I assume running LEMP stacks and sockets are common occurrences with virtualbox users and just wondering if anyone's had the same issue and how they deal with it.

I guess making php listen on a port rather than a socket would fix it but I'd like to recreate the actual servers' configuration as closely as possible. I've also never had this problem with the actual websites but I've never "hard" rebooted them as they're remote servers so maybe this issue would occur to them too after a hard boot. If that's the case and virtualbox is drawing my attention to a potential problem with my live servers it'd be good to troubleshoot it in VB.



Sorry also if I'm hijacking this thread, thought it didn't make sense to start a new post while this is on the front page.
Also it might be of relevance to OP if their missing directories and located in /run/.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Miss OS file directories after reboot of OS

Post by scottgus1 »

pom wrote:I assume running LEMP stacks and sockets are common occurrences with virtualbox users
I wouldn't assume that myself.... (Actually, this is the first time I've heard of a LEMP stack.... And I read the forums a lot. Although I tend to the Windows arena, maybe LEMP is a Linux thing.)

FWIW, though you may have the same issue as the OP, hijacking threads isn't good. Always better to start your own new thread.

And look at if you are using snapshots, and if so whether you are using them properly, and whether you can avoid using them on guests you want to keep for a long time.
pom
Posts: 13
Joined: 9. Aug 2017, 06:18

Re: Miss OS file directories after reboot of OS

Post by pom »

scottgus1 wrote:I wouldn't assume that myself.... (Actually, this is the first time I've heard of a LEMP stack.... And I read the forums a lot. Although I tend to the Windows arena, maybe LEMP is a Linux thing.)

FWIW, though you may have the same issue as the OP, hijacking threads isn't good. Always better to start your own new thread.
I did debate on whether to jump in here or not but this post is only 1 of 3 results I found on google (and the only one specific to virtualbox) and because OP didn't specify which directories they're missing I thought our issues might be related.

I'll maybe post in the Linux section.
scottgus1 wrote:And look at if you are using snapshots, and if so whether you are using them properly, and whether you can avoid using them on guests you want to keep for a long time.
I've only been using virtual box for a couple of days ( I tried it once long ago), and I've only ever closed my guests with the "power off" option till I read this thread and read up on the different options. "Power off" I know now is akin to pulling the plug so I tried the others and only "save the machine state" keeps the directory persistent. Is that a snapshot?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Miss OS file directories after reboot of OS

Post by mpack »

I assume that LEMP is a typo, and LAMP is intended (acronym meaning Linux-Apache-MySql-PHP, a common stack). If 'E' is deliberate then I don't know what it means.
pom
Posts: 13
Joined: 9. Aug 2017, 06:18

Re: Miss OS file directories after reboot of OS

Post by pom »

mpack wrote:I assume that LEMP is a typo, and LAMP is intended (acronym meaning Linux-Apache-MySql-PHP, a common stack). If 'E' is deliberate then I don't know what it means.
LEMP uses Nginx instead of Apache. Sometimes written as LNMP but I guess LEMP (for eNGINe-X) rolls off the tongue better.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Miss OS file directories after reboot of OS

Post by scottgus1 »

pom wrote:Power off" I know now is akin to pulling the plug
This is correct. If your guest has not completed storing data then the data will be lost.

Save-state is not a snapshot. Save-state is somewhat like Windows' Hibernate feature, except that the guest OS does not know it has been turned off. It picks up right where it left off, except that suddenly the clock has jumped forward a few minutes/hours/decades, and the networks have lost connection for a bit.

Snapshots are a little like Windows' System Restore points. They don't serve as backups, and they make a guest more delicate. If you want to experiment with snapshots only use them on guests you wouldn't mind losing if something goes wrong, not on important guests.

Have you tried shutting down the guest from within the guest's OS, using its built-in Shut Down feature? Does a normal happy shutdown every time here. If you want to get the guest to shut down nicely without interfacing with the guest OS during normal operation, get the guest to respond to the ACPI shutdown signal (equivalent to tapping the main power pushbutton on a physical PC). Modern guests should have a "what do I do when the big power button is pressed" setting - set it to shut down, and try "Send the Shutdown Signal" or Machine menu, ACPI Shutdown.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Miss OS file directories after reboot of OS

Post by scottgus1 »

And if Mpack doesn't know what LEMP is, you can safely say not very many Virtualbox users use it... :lol:
Post Reply