Ubuntu – Can Ubuntu Server be run through Ubuntu Desktop


I have both Ubuntu Server and Ubuntu Desktop on a hard drive. But I was wondering if there is a way to have the server running while I am on the Desktop version?

Does this make sense?

Best Answer

You can chroot into the server system, but getting it to work properly as a server this way would be complicated and unworthwhile.

Instead you should probably simply install the packages you need in the desktop system.

The only difference between Ubuntu Server and Ubuntu desktop is what packages are installed. An Ubuntu desktop system can be used as a server (and likewise, a GUI can be installed in Ubuntu Server).

For example, if you need the Apache web server, you can install the apache2 package.

For nginx (you tagged your question but didn't mention it explicitly), you can choose between the following packages: nginx-full, nginx-light, and nginx-naxsi. Related packages you may want or not want (depending on your needs) are nginx-naxsi-ui and nginx-extras.

If your goal is to create a teaching/learning or development box:

You later mentioned:

This isn't for production, but due to my job, I will need to learn how to setup/update/manage servers, so I thought I would turn an old PC into a server. I haven't used anything like virtual box as you cannot access it remotely (as far as I am aware).

VirtualBox (or another virtualization solution, if you prefer) is actually the best thing to use in this situation.

You can actually use VirtualBox and access it remotely, and since your goal is to practice with a system that works like a production server, it seems that's probably what you ought to do. The simplest and easiest way to make services on a virtual machine accessible to the outside physical network is to set up the VM's internet connection as bridged (rather than NAT).

As the VirtualBox manual says:

[...] open the Settings dialog of a virtual machine, go to the "Network" page and select "Bridged network" in the drop down list for the "Attached to" field. Finally, select desired host interface from the list at the bottom of the page, which contains the physical network interfaces of your systems.

Feel free to post a new question about this if you have trouble getting servers on a VirtualBox guest system with a bridged network adapater accessible from the outside. Usually, there are no complications.

While VirtualBox and other virtualization solutions generally can use an entire physical drive as a "virtual" device for a virtual machine--even, usually, an internal drive--you're not likely to succeed at making a VM use the single partition of a pre-existing system as its hard drive. So you'll have to create a new VM and install Ubuntu Server; you probably will not be able to make your VM run the copy of Ubuntu Server that is already installed. (Installing in the VM is easy though--it's the same procedure as installing on a physical machine, like you have done.)

Related Question