Jump to content

Issues installing KVM

Go to solution Solved by Jarno.,
5 minutes ago, TheDutchMC04 said:

yep that did the trick! Apparently the firewall was being a pain too, you happen to know which ports I'd need to allow? or a range of ports?

 

sudo ufw allow vnc
sudo ufw allow spice
sudo ufw allow ssh

The commands above should do the trick depending on the protocol you might be using.

 

Edit: you can check the rules that are active by running " sudo ufw status '

hi @TheDutchMC04

 

Can you explain what you mean? Do you install the VM trough the GUI (Virtmanger) or trough the CLI? You might want to try to install via the command line as sometimes the GUI can glitch when installing a VM with a ISO file.

 

virt-install \ 
  --name <name for vm> \ 
  --memory 2048 \ 
  --vcpus 2 \ 
  --disk size=20G \ 
  --cdrom <path to ISO \ 
  --os-variant <rhel7 ubuntu, windows> 

Edit: Can you post any error message's you might be get?

Link to comment
https://linustechtips.com/topic/1106866-issues-installing-kvm/#findComment-12911702
Share on other sites

Link to post
Share on other sites

1 minute ago, Jarno. said:

hi @TheDutchMC04

 

Can you explain what you mean? Do you install the VM trough the GUI (Virtmanger) or trough the CLI? You might want to try to install via the command line as sometimes the GUI can glitch when installing a VM with a ISO file.

 


virt-install \ 
  --name <name for vm> \ 
  --memory 2048 \ 
  --vcpus 2 \ 
  --disk size=8 \ 
  --cdrom <path to ISO \ 
  --os-variant <rhel7 ubuntu, windows> 

 

doing CLI, running 

sudo virt-install --virt-type=kvm --name ubuntu19 --ram 4096 --vcpus=2 --os-variant ubuntu17.04 --graphics vnc --cdrom=/var/lib/libvirt/boot/ubuntu-19.04-desktop-amd64.iso --disk path=/var/lib/libvirt/images/ubuntu19.img,size=40

 

Link to comment
https://linustechtips.com/topic/1106866-issues-installing-kvm/#findComment-12911708
Share on other sites

Link to post
Share on other sites

4 minutes ago, TheDutchMC04 said:

doing CLI, running 


sudo virt-install --virt-type=kvm --name ubuntu19 --ram 4096 --vcpus=2 --os-variant ubuntu17.04 --graphics vnc --cdrom=/var/lib/libvirt/boot/ubuntu-19.04-desktop-amd64.iso --disk path=/var/lib/libvirt/images/ubuntu19.img,size=40

 

For troubleshooting you might want to take " --graphics vnc " and  " --disk path "  away. Those are not required as /var/lib/libvirt is the default directory for KVM anyway. Also " --ram " should be memory i think.

 

More info : https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/virtualization_deployment_and_administration_guide/sect-guest_virtual_machine_installation_overview-creating_guests_with_virt_install

Link to comment
https://linustechtips.com/topic/1106866-issues-installing-kvm/#findComment-12911711
Share on other sites

Link to post
Share on other sites

1 minute ago, Jarno. said:

For troubleshooting you might want to take " --graphics vnc " and  " --disk path "  away. Those are not required as /var/lib/libvirt is the default directory for KVM anyway. Also " --ram " should be memory i think.

Disk path does seem to be necessary

Link to comment
https://linustechtips.com/topic/1106866-issues-installing-kvm/#findComment-12911715
Share on other sites

Link to post
Share on other sites

21 minutes ago, TheDutchMC04 said:

Taking out the --display, and changing --ram to --memory did not affect thingsou

Hi,

 

Tried now myself and ran in the same problem because you need package virt-viewer appearently. You use a headless server so you might need to connect to VNC from another PC using virt-viewer. Check picture below.

 

Spoiler

image.png.1b594f31a6449ec9b6ae2e60d81b4f88.png

 

Link to comment
https://linustechtips.com/topic/1106866-issues-installing-kvm/#findComment-12911740
Share on other sites

Link to post
Share on other sites

19 minutes ago, Jarno. said:

Hi,

 

Tried now myself and ran in the same problem because you need package virt-viewer appearently. You use a headless server so you might need to connect to VNC from another PC using virt-viewer. Check picture below.

 

  Hide contents

image.png.1b594f31a6449ec9b6ae2e60d81b4f88.png

 

so download the package virt-viewer on the headless server, and a VNC viewer on another device?

Link to comment
https://linustechtips.com/topic/1106866-issues-installing-kvm/#findComment-12911782
Share on other sites

Link to post
Share on other sites

10 minutes ago, TheDutchMC04 said:

so download the package virt-viewer on the headless server, and a VNC viewer on another device?

Yes VNC (tightvnc) or via spice (virt-viewer) should work. You can temporary disable the firewall to make it easier. A hird option is to connecting remotely from another host using virtual manager (virt-manager). The easiest way to do this is by allowing root SSH and connect trough SSH. (allowing root SSH is a security issue so you might not want to do this on a production server)

 

sudo ufw disable
Spoiler

image.png.02a895aa7a5e942bc7586019b24346cf.png

 

Link to comment
https://linustechtips.com/topic/1106866-issues-installing-kvm/#findComment-12911798
Share on other sites

Link to post
Share on other sites

3 minutes ago, Jarno. said:

Yes VNC (tight-vnc) or via spice (virt-viewer) should work. You can temporarily disable the firewall to make it easier. As third option is connecting remotely to another host using virtual manager (virt-manager). The easiest way to do this is by allowing root SSH and connect trough SSH.

 


sudo ufw disable
  Reveal hidden contents

image.png.02a895aa7a5e942bc7586019b24346cf.png

 

yep that did the trick! Apparently the firewall was being a pain too, you happen to know which ports I'd need to allow? or a range of ports?

 

Link to comment
https://linustechtips.com/topic/1106866-issues-installing-kvm/#findComment-12911809
Share on other sites

Link to post
Share on other sites

5 minutes ago, TheDutchMC04 said:

yep that did the trick! Apparently the firewall was being a pain too, you happen to know which ports I'd need to allow? or a range of ports?

 

sudo ufw allow vnc
sudo ufw allow spice
sudo ufw allow ssh

The commands above should do the trick depending on the protocol you might be using.

 

Edit: you can check the rules that are active by running " sudo ufw status '

Link to comment
https://linustechtips.com/topic/1106866-issues-installing-kvm/#findComment-12911822
Share on other sites

Link to post
Share on other sites

1 minute ago, Jarno. said:

sudo ufw allow vnc
sudo ufw allow spice
sudo ufw allow ssh

The commands above should do the trick depending on the protocol you might be using.

Ah, thankyou! Now a weird thing, after completing the ubuntu install on the VM, it shutdown, as it normally does with a new install, I want to fire it back up, go into virsh, do list, and it's empty?

Link to comment
https://linustechtips.com/topic/1106866-issues-installing-kvm/#findComment-12911825
Share on other sites

Link to post
Share on other sites

3 minutes ago, TheDutchMC04 said:

Ah, thankyou! Now a weird thing, after completing the ubuntu install on the VM, it shutdown, as it normally does with a new install, I want to fire it back up, go into virsh, do list, and it's empty?

figured that out, needed to add --all. All seems to be working now. Thanks for your help!

Link to comment
https://linustechtips.com/topic/1106866-issues-installing-kvm/#findComment-12911830
Share on other sites

Link to post
Share on other sites

1 minute ago, TheDutchMC04 said:

figured that out, needed to add --all. All seems to be working now. Thanks for your help!

You're welcome. One more thing, did you run " sudo dnf enable " again after the troubleshooting? This will enable the firewall again.

Link to comment
https://linustechtips.com/topic/1106866-issues-installing-kvm/#findComment-12911833
Share on other sites

Link to post
Share on other sites

28 minutes ago, Jarno. said:

sudo ufw allow vnc
sudo ufw allow spice
sudo ufw allow ssh

The commands above should do the trick depending on the protocol you might be using.

 

Edit: you can check the rules that are active by running " sudo ufw status '

So I tried to install TeamViewer next, which gives a black screen when connecting to it, any ideas?

 

Link to comment
https://linustechtips.com/topic/1106866-issues-installing-kvm/#findComment-12911865
Share on other sites

Link to post
Share on other sites

2 minutes ago, TheDutchMC04 said:

So I tried to install TeamViewer next, which gives a black screen when connecting to it, any ideas?

 

Do you mean that you are trying to run teamviewer within the VM so you can connect to it remotely? First things that comes up to me that it can be either the firewall or that the user logged in has root/admin privileges at the moment of connecting. Teamviewer won't allow you to use high privileges. The screen will then blackout. 

Link to comment
https://linustechtips.com/topic/1106866-issues-installing-kvm/#findComment-12911873
Share on other sites

Link to post
Share on other sites

Just now, Jarno. said:

Do you mean that you are trying to run teamviewer within the VM so you can connect to it remotely? First things that comes up to me that it can be either the firewall or that the user logged in has root/admin privileges at the moment of connecting. Teamviewer won't allow you to use high privileges. The screen will then blackout. 

What I have read online so far is that it is because the GPU doesn't send any data if there's no monitor, which is the case with a VM, so then Teamviewer wont pickup a signal. is there any way to forward the video to the GPU output?

Link to comment
https://linustechtips.com/topic/1106866-issues-installing-kvm/#findComment-12911875
Share on other sites

Link to post
Share on other sites

10 minutes ago, TheDutchMC04 said:

What I have read online so far is that it is because the GPU doesn't send any data if there's no monitor, which is the case with a VM, so then Teamviewer wont pickup a signal. is there any way to forward the video to the GPU output?

Yes, you can actually use PCI passthrough. More info can be found here : https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/virtualization/chap-virtualization-pci_passthrough You need a second GPU for this as the VM will fully claim the GPU as his own.

 

With virt-manager it can be done via GUI. Check picture below.

Spoiler

image.png.dfbbb7a1217f58c1caebe0fa80f15388.png

 

Link to comment
https://linustechtips.com/topic/1106866-issues-installing-kvm/#findComment-12911888
Share on other sites

Link to post
Share on other sites

3 minutes ago, Jarno. said:

Yes, you can actually use PCI passthrough. More info can be found here : https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/virtualization/chap-virtualization-pci_passthrough You need a second GPU for this as the VM will fully claim the GPU as his own.

 

With virt-manager it can be done via GUI. Check picture below.

  Hide contents

image.png.dfbbb7a1217f58c1caebe0fa80f15388.png

 

Aquiring a second GPU should be no issue, Ill go and install virt-manager right away. Thanks!

Link to comment
https://linustechtips.com/topic/1106866-issues-installing-kvm/#findComment-12911898
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×