Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
Rep:
Quote:
Originally Posted by oguruma
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.
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.
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
Rep:
Quote:
Originally Posted by oguruma
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 ...
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?
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.
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...
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
Rep:
Quote:
Originally Posted by oguruma
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.
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
Rep:
Quote:
Originally Posted by oguruma
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 ?
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.
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
Rep:
Quote:
Originally Posted by oguruma
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).
$ 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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.