[SOLVED] Installing Ubuntu Server in an external drive

VicenteMMOS

New Member
Joined
Dec 19, 2018
Messages
16
Reaction score
6
Credits
55
Hello, everyone!

I'm running a Manjaro distro in my machine, and I want to set up an Ubuntu Server with Nextcloud as a local home server, for all our day-to-day file usage. I don't have another computer in which to install Ubuntu Server fully, so I was wondering if I could use a 2TB external hard drive as the container of both Ubuntu and storage and sync unit for all our files. It turns out I can install Ubuntu Server in it, no problem, but I can only boot into a single OS at a time. Meaning, if I boot into Manjaro, then Ubuntu is shut down and I can't seem to boot into it remotely. Ideally, I want to interact with Ubuntu from Manjaro itself, read/write files into the server, through Nextcloud, from different devices in our home. In the Ubuntu server installation, I enabled SSH, I opened the default port for server/client communication (port 22), the OS would successfully return ping requests through the internet... so everything was set up correctly. But when I boot into Manjaro, Ubuntu seems to be shut down, and the terminal requests "ssh <username>@<ip_address>" would just return 'ssh: connect to host <ip_address> port 22: No route to host'. Then, I started thinking, maybe I could set up a VM in Virtualbox in order to access the OS in the external drive... but I'm most likely not configuring it correctly. Then, I thought 'maybe in order to make the VM work in the external disk, I should reformat the disk completely, define the VM and save it in there, and only then have it install Ubuntu Server, inside the VM itself'. So, that's where I am now, I reformatted the disk as ext4, but I'm not managing to create a VM inside of it. I chowned the disk to my user and group, so I have full control over it, but somehow, Virtualbox won't allow me to save the VM inside that disk... I don't know if what I'm trying to do is even feasible at all, or if I'm just doing something wrong. Can anyone help please?

Thank you so much.
 


Did you add yourself to the vbox user list?

sudo usermod -aG vboxusers USERNAME

Then reboot

Boot USB in VirtualBox

open terminal and type in


locate thumb-drive with Linux installed - in this example it is /dev/sdb
# /dev/sdb is the device with the USB

VBoxManage internalcommands createrawvmdk -filename ~/.VirtualBox/HardDisks/usb.vmdk -rawdisk /dev/sdb -register

# Sometimes you need to give special permissions ...

sudo chmod 666 /dev/sdb*

sudo chown whoami ~/.VirtualBox/HardDisks/usb.vdmk
 
Last edited:
Did you add yourself to the vbox user list?



Then reboot

Boot USB in VirtualBox

open terminal and type in



locate thumb-drive with Linux installed - in this example it is /dev/sdb
# /dev/sdb is the device with the USB



# Sometimes you need to give special permissions ...
Hey, thanks for your reply.

I'm doing what you suggested, and just added my own user to vbox's user list. Now, after reboot, I don't understand to 'Boot USB in VirtualBox'. What exactly should I do here? I'm guessing it's not booting up on Manjaro and then trying to create the VM in the external drive, right? Sorry, I'm not too familiar with Linux, OS's or commands.

Thank you.
 
In a VM environment you have to have the main OS running before the VM can run - in your case Manjaro has to be running before Ubuntu server - the above commands will boot Ubuntu Server in the VM but only after Manjaro is running - you cannot run a VM without the main OS running first - it is like an OS within an OS
 
In a VM environment you have to have the main OS running before the VM can run - in your case Manjaro has to be running before Ubuntu server - the above commands will boot Ubuntu Server in the VM but only after Manjaro is running - you cannot run a VM without the main OS running first - it is like an OS within an OS
That I understand.. that wasn't my doubt. I didn't manage before to create the VM in the ext drive. Then you suggested I added my user to the vbox user list, and I did, but then I didn't understand what you meant by booting USB in vbox. This is a new piece of information, I managed to save a UbuntuServer.vdi file inside the ext drive (associated to ubuntu-22.04.3-live-server-amd64.iso file), but then when I try starting the VM I get the following error:
Kernel driver not installed (rc=-1908)
The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please, try
 
Just a follow up, I managed to do it! =) I kept insisting, asking ChatGPT for help, and it posted me quite a lot of actions was should try. In the end, it turned out to be a problem with a few VirtualBox dependencies. I had to try installing various dependencies, many of which wouldn't go through. I kept insisting, back and forth with ChatGPT, until it suggested I installed the dependencies one by one, and after a couple of those were apparently installed correctly, I managed to save the VM into the external drive, boot into it, and install Ubuntu Server. Now, I'm kind of stuck trying to have my local machine communicate with the VM's server, but well, one problem at a time. =) thanks anyway!
 


Top