LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-27-2017, 09:35 AM   #1
oguruma
LQ Newbie
 
Registered: Feb 2017
Posts: 23

Rep: Reputation: Disabled
Virtualbox/Nextcloud: Add "virtual" data drive?


Here is what I currently have. A Debian machine with Virtualbox and PHP Virtualbox installed. It has a 120GB SSD as the boot drive and a 2TB HDD installed.

I want to use the 2TB drive to backup an existing file share (only need 1TB for the foreseeable future). I also want to use about 500GB for a "data drive" for a Ubuntu/Nextcloud Virtualbox.

Based on what I have gathered so far, I should make a 1TB partition (backup existing CIFS share) and a 500GB partition (Nextcloud).

I would use Rsync to backup the existing CIFS share to the 1TB Partition, and then back up the Nextcloud Data back to my FreeNAS box.

So I guess my questions are, and the help I need (and really do appreciate) is:

1. Am I on the right track with how to set this up?

2. What are the commands to make partitions once the drive is physically installed? I tried to do this on my own, but I screwed something up and the box would only boot into safe mode.

3. What is the best networking configuration if I wanted to expose this to the internet? I have a PFSense Router running with an unused port I could use as a DMZ.

4. Is it possible to run an HTTPS (Nextcloud) server as well as HTTP servers with one IP from my ISP?

5. As I understand it, I can use an existing partition as a virtual disk in Virtualbox, or I can use a shared folder. What are the pros/cons of each?

6. Can a DMZ be virtualized via Virtualbox?
 
Old 02-27-2017, 12:26 PM   #2
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Quote:
Originally Posted by oguruma View Post
Here is what I currently have. A Debian machine with Virtualbox and PHP Virtualbox installed. It has a 120GB SSD as the boot drive and a 2TB HDD installed.

I want to use the 2TB drive to backup an existing file share (only need 1TB for the foreseeable future). I also want to use about 500GB for a "data drive" for a Ubuntu/Nextcloud Virtualbox.

Based on what I have gathered so far, I should make a 1TB partition (backup existing CIFS share) and a 500GB partition (Nextcloud).

I would use Rsync to backup the existing CIFS share to the 1TB Partition, and then back up the Nextcloud Data back to my FreeNAS box.

So I guess my questions are, and the help I need (and really do appreciate) is:

1. Am I on the right track with how to set this up?

2. What are the commands to make partitions once the drive is physically installed? I tried to do this on my own, but I screwed something up and the box would only boot into safe mode.

3. What is the best networking configuration if I wanted to expose this to the internet? I have a PFSense Router running with an unused port I could use as a DMZ.

4. Is it possible to run an HTTPS (Nextcloud) server as well as HTTP servers with one IP from my ISP?

5. As I understand it, I can use an existing partition as a virtual disk in Virtualbox, or I can use a shared folder. What are the pros/cons of each?

6. Can a DMZ be virtualized via Virtualbox?
Hi ogurama - I can offer my opinion on some, but not all, of your questions:

1, 2 & 5 : For the sake of simplicity, I wouldn't bother partitioning the 2 TB drive at all for your described needs. I would create a directory to hold the backup of the other file system. As for Virtualbox, it creates virtual disks as files (vdi or vdmk files, essentially ...), so I would just create another directory to hold your virtual machine "disks" (files). Again, I see no need nor advantage to creating a separate partition to do this.

6 : I'm not sure I even understand this question. A hypervisor like Virtualbox creates virtual machines that function as a physical computer would, with whatever operating system you choose to set them up with. A DMZ is a zone in a network that is accessible from outside that network (ex. the Internet) but still distinct from another protected area of the network - a kind of "no-man's land" if you will. ... Anyway, you probably already know this ... my point here is that a DMZ is more of a networking-segmentation concept whereas Virtualbox is a hypervisor, so a single machine based concept. Sorry if I'm missing your intended point - please feel free to clarify.

Cheers !
 
1 members found this post helpful.
Old 02-27-2017, 12:39 PM   #3
oguruma
LQ Newbie
 
Registered: Feb 2017
Posts: 23

Original Poster
Rep: Reputation: Disabled
Thanks for your reply! What you said in respect to 1, 2 and 5 makes sense, and I think I will go that route. Do you happen to know the commands to make a virtual disk from a drive other than the boot drive? As I understand it, if I try to add another virtual disk, it will, by default, do so on the boot drive.
 
Old 02-27-2017, 12:49 PM   #4
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Quote:
Originally Posted by oguruma View Post
Thanks for your reply! What you said in respect to 1, 2 and 5 makes sense, and I think I will go that route. Do you happen to know the commands to make a virtual disk from a drive other than the boot drive? As I understand it, if I try to add another virtual disk, it will, by default, do so on the boot drive.
I apologize in advance - I'm not sure I understand this last question. Virtualbox doesn't create virtual drives from existing physical drives ... It creates an empty virtual drive onto which you then install an operating system and whatever else you want. You CAN use a previously created virtual drive and import it into Virtualbox to then use, but I don't think this is what you are describing ... If your question is concerning which physical drive and / or directory Virtualbox will use to store your virtual drives, you can specify this when creating them or even use Virtualbox's Media Manager tool to move them.

Please let me know if I've completely missed your intended point ...
 
Old 02-27-2017, 01:09 PM   #5
oguruma
LQ Newbie
 
Registered: Feb 2017
Posts: 23

Original Poster
Rep: Reputation: Disabled
I have a boot drive as 120GB SSD (sdb1) and I have a second, 2TB HDD (sda1). I want 500GB of storage space for my nextcloud server. Unless I tell virtualbox to make me some space on the 2TB drive, I will not be able to get 500GB of space for the Nextcloud. Or am I misunderstanding how this works?
 
Old 02-27-2017, 01:44 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,592

Rep: Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880
Although Virtualbox can use a physical raw host disk or ISCSI typically one uses a virtual disk image i.e VDI,VMDK or VHD which is nothing more then a regular file on the host system. As stated you can create a separate virtual disk located anywhere on the host independent from the guest image and attach it to a virtual disk controller using VBox manager. Then boot the guest and it should show up like any other disk which you can partition/format using any tool like gparted.

https://www.virtualbox.org/manual/ch05.html
 
Old 02-27-2017, 01:53 PM   #7
oguruma
LQ Newbie
 
Registered: Feb 2017
Posts: 23

Original Poster
Rep: Reputation: Disabled
Okay I understand now. So, I partitioned the new drive and mounted it (/mnt/data). Then, I made a directory just for the Nextcloud data (/mnt/data/nextcloud).

When I try to create a vdi in /mnt/data/nextcloud I get error message "Could not create the medium storage unit '/mnt/data/nextcloud/UbuntuNextCloud3.vdi'. VDI: cannot create image '/mnt/data/nextcloud/UbuntuNextCloud3.vdi' (VERR_ACCESS_DENIED)


I am assuming that it's a permissions issue, but I am not sure where to go from here...
 
Old 02-27-2017, 02:22 PM   #8
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Quote:
Originally Posted by oguruma View Post
I have a boot drive as 120GB SSD (sdb1) and I have a second, 2TB HDD (sda1). I want 500GB of storage space for my nextcloud server. Unless I tell virtualbox to make me some space on the 2TB drive, I will not be able to get 500GB of space for the Nextcloud. Or am I misunderstanding how this works?
Hi ogurama - I think I understand what you want to do with Virtualbox :

- From your original post, your physical machine is running Debian and you also have Virtualbox installed.

- You want to create a virtual machine in Virtualbox to install Ubuntu

- You want to run a web server called "Nextcloud" on the Ubuntu virtual machine

- You want the Ubuntu virtual machine with Nextcloud on it to have 500GB of disk space.

If this is true (please correct me if not), then you just need to do the following:

- Create a directory on your 2 TB disk drive that will hold your Virtual machines ("VBoxVMs", for example ... your choice ...)

- In Virtualbox, go to Preferences and specify the previously created directory as your default machine folder

- Create a virtual machine in Virtualbox, choosing Linux and Ubuntu 64-bit as its profile in the initial steps of creation.

- When you get to that step, have Virtualbox create either a .vdi (Virtualbox native format) or a .vdmk (... if you want compatibility with VMWare) format new virtual disk drive, and choose dynamically allocated disk space.

- Specify a maximum size of 500GB when prompted

- Once the VM is created, install Ubuntu and then Nextcloud.

... That's pretty well it ...

Let me know if you need any further help !
 
Old 02-27-2017, 02:28 PM   #9
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Quote:
Originally Posted by oguruma View Post
Okay I understand now. So, I partitioned the new drive and mounted it (/mnt/data). Then, I made a directory just for the Nextcloud data (/mnt/data/nextcloud).

When I try to create a vdi in /mnt/data/nextcloud I get error message "Could not create the medium storage unit '/mnt/data/nextcloud/UbuntuNextCloud3.vdi'. VDI: cannot create image '/mnt/data/nextcloud/UbuntuNextCloud3.vdi' (VERR_ACCESS_DENIED)


I am assuming that it's a permissions issue, but I am not sure where to go from here...
... does indeed sound like a permissions issue ... Did you create the "nextcloud" directory using the same user id as the one with which you run Virtualbox ?

What do you get as output from :

$ ls -l /mnt/data

?
 
Old 02-27-2017, 02:28 PM   #10
oguruma
LQ Newbie
 
Registered: Feb 2017
Posts: 23

Original Poster
Rep: Reputation: Disabled
Rickkk, you are correct in what I am trying to accomplish. When changing the machine folder, I still have the same issue when trying to set it to sda1 (the larger HDD) and that is ...verr_access_denied.
 
Old 02-27-2017, 02:32 PM   #11
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Quote:
Originally Posted by oguruma View Post
Rickkk, you are correct in what I am trying to accomplish. When changing the machine folder, I still have the same issue when trying to set it to sda1 (the larger HDD) and that is ...verr_access_denied.
OK. Type the following command and paste its output:

$ ls -l /mnt/data

... and also please specify how you mounted: command line (list the command you used) or fstab (list your entry).

Last edited by Rickkkk; 02-27-2017 at 02:37 PM.
 
Old 02-27-2017, 02:49 PM   #12
oguruma
LQ Newbie
 
Registered: Feb 2017
Posts: 23

Original Poster
Rep: Reputation: Disabled
NOTE: I recreated the directory as /data, rather than /mnt/data. sda1 has been mounted to /data

$ ls -l /data
ls: cannot access /data/data: Permission denied
ls: cannot access /data/lost+found: Permission denied
ls: cannot access /data/nextclouddata: Permission denied
total 0
d????????? ? ? ? ? ? data
d????????? ? ? ? ? ? lost+found
d????????? ? ? ? ? ? nextclouddata



HOWEVER

$ sudo ls -l /data
total 24
drwxr-xr-x 3 root root 4096 Feb 27 11:49 data
drwx------ 2 root root 16384 Feb 27 11:41 lost+found
drwxr-xr-x 2 root root 4096 Feb 27 12:46 nextclouddata
 
Old 02-27-2017, 03:35 PM   #13
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Quote:
Originally Posted by oguruma View Post
NOTE: I recreated the directory as /data, rather than /mnt/data. sda1 has been mounted to /data

$ ls -l /data
ls: cannot access /data/data: Permission denied
ls: cannot access /data/lost+found: Permission denied
ls: cannot access /data/nextclouddata: Permission denied
total 0
d????????? ? ? ? ? ? data
d????????? ? ? ? ? ? lost+found
d????????? ? ? ? ? ? nextclouddata



HOWEVER

$ sudo ls -l /data
total 24
drwxr-xr-x 3 root root 4096 Feb 27 11:49 data
drwx------ 2 root root 16384 Feb 27 11:41 lost+found
drwxr-xr-x 2 root root 4096 Feb 27 12:46 nextclouddata
OK - first, answer my other question concerning how you mounted the drive - write permissions other than for root depend on the method and the options specified.

..... Secondly - it looks like you created those directories with the root account (or by using sudo). That's at least one reason you can't access them with anything ... Best would be to remove data and its subdirectories and, once we figure out the answer to the above mounting question, we'll recreate them with the same user account you use with Virtualbox (probably your regular linux user account on Debian).


... We'll get there !

Last edited by Rickkkk; 02-27-2017 at 04:01 PM.
 
Old 02-27-2017, 04:11 PM   #14
oguruma
LQ Newbie
 
Registered: Feb 2017
Posts: 23

Original Poster
Rep: Reputation: Disabled
I didn't make any changes to fstab, so I guess I can start over when if I reboot. I believe the command I used was mount /dev/sda1 /data.
 
Old 02-27-2017, 04:13 PM   #15
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,592

Rep: Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880
You can use chmod and chown to change permissions/owner without the need to recreate existing directories or reboot.

https://www.linux.com/learn/how-mana...missions-linux
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to add new drives to a VirtualBox virtual machine LXer Syndicated Linux News 0 10-27-2016 01:01 PM
How do I expand a partition less virtual drive while preserving the data? MissingPixels Linux - Hardware 1 11-19-2013 12:56 PM
[HOWTO] add a sata drive to virtualbox aus9 Linux - Software 1 03-17-2010 07:52 PM
[SOLVED] How to add another drive image to an existing VM using VirtualBox? colucix Linux - Software 2 08-31-2009 04:38 AM
how to add new drive to existing software RAID 0 without losing the data? superbo Linux - Hardware 2 06-12-2007 09:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration