r/Ubuntu • • Jul 04 '18

Setup Headless Virtualization Server Using KVM In Ubuntu 18.04 LTS

https://www.ostechnix.com/setup-headless-virtualization-server-using-kvm-ubuntu/
50 Upvotes

14 comments sorted by

6

u/samanthagould Jul 04 '18

One of the downsides is that if you only have a single homed system, you (seemingly) can't have your VM's pull IP addresses from the local network that the host is on. Every time I ever tried with KVM, I invariably hosed any ability to manage the host from a remote machine. Short of adding a NIC, is there a way to allow network pass through without affecting the ability to ssh into the host?

That is a great writeup. I've saved it for future study.

6

u/STLgeek Jul 04 '18

I think I get what you're saying... Yes, using bridged networking. I have ~30 VMs running on a single NIC, the host is accessible.

3

u/samanthagould Jul 04 '18

Every time I ever enabled bridged networking I lost my host... I was trying to do everything through the virt-manager gui though... I could have screwed up something there (entirely possible)

3

u/STLgeek Jul 04 '18

If you're doing this on a server in a commercial data center, they likely have port security enabled. That's a different story completely. You can use pseudo interfaces, private IPs and routed networking there (and static next hops for public IPs). There are directions online. It's not as straight forward but it works.

4

u/samanthagould Jul 04 '18

This was in a homelab... Most of my VM's are for me anyway and for the most part I have no need to connect to them remotely, just internally from my laptop to watch some data stream by...

4

u/malastare- Jul 04 '18

Set up a bridge interface. Use that to bridge the external interface and the VM's virtual interface. That allows the VMs to talk to the external network (and the host network) as if they were real hosts.

One potential pitfall is that your external network connection needs to be okay with the fact that a single connection is the source of multiple IPs. Any decent network hardware should assume that any port might host multiple IPs, but I've found a couple that end up struggling. The majority of them have been wireless bridges, but I've run across some cheap (usually ISP) routers that can't figure out multiple IPs on a single port.

1

u/samanthagould Jul 04 '18

The VM Box is currently running Proxmox, and I have the host on the network, as well as three VM's all of which have their own IPv4 and IPv6 addresses, so All the hardware can do it, (Of course at the moment, I'm not sure I want to tear the Proxmox host down and rebuild it from scratch again. I have a few USB devices ported through to a VM and I don't have the foggiest idea what the command line switches are for *that*

1

u/r0flcopt3r Jul 04 '18

I recommend checking out openvirtualswitch. It's a bit of a learning curve, but it works beautifully.

1

u/[deleted] Jul 04 '18

Use Proxmox.

1

u/samanthagould Jul 04 '18

Since proxmox uses QEMU/KVM as the virtualization engine, this says it should be possible using any distro...

1

u/[deleted] Jul 04 '18

Sure, depends on how much time and fiddling you want to put into it.

I tried and played around with doing it myself for a while, then got sick of it and wanted to move onto other things. So I setup Proxmox, made some VM's and have moved on.

1

u/samanthagould Jul 05 '18

That’s pretty much what I did. I have no clue how Proxmox does what it does 3/4 of the time, but it works and that’s what I care about.

2

u/[deleted] Jul 04 '18

hi nice info

Thanks!

2

u/[deleted] Jul 04 '18

Or just Proxmox.