Complete and utter stupidity with permissions

Status
Not open for further replies.

Spud

Contributor
Joined
Oct 23, 2011
Messages
117
Hi,

I'm not sure if this matters but I'm running FreeNAS-9.3-STABLE-201506292130

I have done something completely stupid late one night while not paying attention and I can honestly say it will never happen again.

What I did was accidental modify the permissions to all directories and files in the Jails directory.

Now VirtualBox will not start and gives me this error

Code:
Exception Object
(
  [message:protected] => Could not connect to host (http://127.0.0.1:18083/)
  [string:Exception:private] =>
  [code:protected] => 64
  [file:protected] => /usr/local/www/phpvirtualbox/lib/ajax.php
  [line:protected] => 128
  [trace:Exception:private] => Array
  (
  )

  [previous:Exception:private] =>
)


And I cannot seem to work out just how to go about fixing this problem.

I've looked at the file "/usr/local/www/phpvirtualbox/lib/ajax.php"

Line 128 says "throw new Exception($e->getMessage(), $e->getCode());"

No idea what the hell that means.

Can I just copy the VM's I have installed to another directory delete VirtualBox and reinstall it then copy the VM's back fire it up and everyones happy again or is there an easier way to resolve this?

So if anyone that can point me in the right direction here
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,996
So I honestly have no idea what the correct answer is but if I were you I'd do what you suggested which is copy all your VM's and remove VirtualBox completely. Then try to recreate VirtualBox.

So what exactly did you do? What permissions did you set? Another option could be to just set all permissions to 777 but that is not really the correct way to fix it.
 

styno

Patron
Joined
Apr 11, 2016
Messages
466
What I did was accidental modify the permissions to all directories and files in the Jails directory.
Do you have (recursive) snapshots setup on you pool or datasets? If so you can rollback to a snapshot of your jails directory before your manipulations.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Roll back to a snapshot or rebuild. There is no fixing this without starting over. Problem hundreds of threads on here from people doing this.
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
One of the reasons I keep hourly snapshots of my entire pool for at least a few days... even the datasets I "don't keep snapshots" for.
 

Spud

Contributor
Joined
Oct 23, 2011
Messages
117
So I honestly have no idea what the correct answer is but if I were you I'd do what you suggested which is copy all your VM's and remove VirtualBox completely. Then try to recreate VirtualBox.

So what exactly did you do? What permissions did you set? Another option could be to just set all permissions to 777 but that is not really the correct way to fix it.


I set the permissions to user spud group xyz 770
 

Spud

Contributor
Joined
Oct 23, 2011
Messages
117
Do you have (recursive) snapshots setup on you pool or datasets? If so you can rollback to a snapshot of your jails directory before your manipulations.

Nope I don't but one thing I will say is that it will be the first thing I setup once this problems fixed!
 

Spud

Contributor
Joined
Oct 23, 2011
Messages
117
One of the reasons I keep hourly snapshots of my entire pool for at least a few days... even the datasets I "don't keep snapshots" for.

This might have helped but I made the stuff up over 2 weeks ago it was only when I tried to reboot the VM after an update that I became aware of the problem. So if they were hourly I'd have to go back around 340 snapshots but still a hell of a lot easier then trying to fix it this way! :(
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,996
Be cautious about snapshots, they eat up storage space. So if you have them setup and a few weeks later you ask yourself what happened to all that space you had? Well it's snapshots more often than not.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
I've had a quick look at one of mine, and almost everything is root:wheel with the exception of /home/vbox which is vbox:vbox. Possibly worth a try?
 

Spud

Contributor
Joined
Oct 23, 2011
Messages
117
I've had a quick look at one of mine, and almost everything is root:wheel with the exception of /home/vbox which is vbox:vbox. Possibly worth a try?

Thanks for that I have tried replacing all the permissions with root:wheel but don't seem to have a user or group called vbox which seems strange to me.
 

Spud

Contributor
Joined
Oct 23, 2011
Messages
117
Be cautious about snapshots, they eat up storage space. So if you have them setup and a few weeks later you ask yourself what happened to all that space you had? Well it's snapshots more often than not.

Yeah maybe once a week or so would be a better idea
 

styno

Patron
Joined
Apr 11, 2016
Messages
466
It really depends on your data and how much it changes in the timespan that you are keeping your snapshots.
As ZFS will only copy a block in snapshot space when the data is actually changed. A dataset that contains your documents or family pictures will typically not change a lot and can have hourly snapshots. With this in place you will be able to go back 1 hr in time and not lose your documents that you created a few days ago.
A dataset where for example all the data is deleted at once and regenerated afterwards will eat up a lot of storage space if said snapshot schedule is applied.
 

Spud

Contributor
Joined
Oct 23, 2011
Messages
117
It really depends on your data and how much it changes in the timespan that you are keeping your snapshots.
As ZFS will only copy a block in snapshot space when the data is actually changed. A dataset that contains your documents or family pictures will typically not change a lot and can have hourly snapshots. With this in place you will be able to go back 1 hr in time and not lose your documents that you created a few days ago.
A dataset where for example all the data is deleted at once and regenerated afterwards will eat up a lot of storage space if said snapshot schedule is applied.


The snapshots here would be massive if thats the case, lots of large data just about every single day
 

styno

Patron
Joined
Apr 11, 2016
Messages
466
I did try this btw, wouldn't start and complaining about world permissions
I really hope you took a snapshot this time *before* you did this?

The snapshots here would be massive if thats the case for me, lots of large data just about every single day
If this large amount of data is just added each day and no old data is deleted, then it doesn't matter. Just remember that if data is deleted it will stay on disk as long as the snapshots are kept on disk.
 

Spud

Contributor
Joined
Oct 23, 2011
Messages
117
I really hope you took a snapshot this time *before* you did this?

No I didn't, right now I'm coping all the VM's to another drive and will be removing virutalbox and reinstalling it, hopefully this will fix the problem I'll then copy all the VM's back and see what happens.

I shall let you good people know the out come! :)
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,996
Good Luck.
 

Spud

Contributor
Joined
Oct 23, 2011
Messages
117
Just out of curiosity should I delete everything here you think and just start everything from new? I think that would probably be the best option?!?

drwxr-xr-x 2 root wheel 18 Jan 31 2015 .VirutalBox.meta/
drwxr-xr-x 3 root wheel 3 Jan 25 2015 .plugins/
drwxr-xr-x 5 root wheel 5 Dec 3 2015 .warden-files-cache/
drwxr-xr-x 17 root wheel 23 Jan 31 2015 .warden-template-VirtualBox-4.3.12/
drwxr-xr-x 18 root wheel 22 Jan 25 2015 .warden-template-pluginjail--x64/
drwxr-xr-x 18 root wheel 22 Dec 3 2015 .warden-template-pluginjail--x64-20151206171428/
drwxr-xr-x 18 root wheel 22 Jul 9 19:09 .warden-template-pluginjail--x64-20160710083033/
drwxr-xr-x 17 root wheel 23 Jan 31 2015 VirutalBox/
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
Yeah maybe once a week or so would be a better idea

It's not the snapshots that eat space, but rather the deletions and changes which have happened.
 
Status
Not open for further replies.
Top