#libvirt
Explore tagged Tumblr posts
chillywillycd-blog · 2 years ago
Text
gnome-boxes vms using virt-manager bridged network
I started with using gnome-boxes.
it was flaky
i've started primarliy using virt-manager ( virsh --connect qemu:///session to be able to talk to the domains)
i wanted to share services from my hypervisor host (ubuntu 20.04 currently). primarily, because i'm still on old versions of libvirt/hypervisor kernel/whever else virtiofs isn't available to me without extra work, so i want to nfs share host files because sshfs doesn't support symlinks.
i found a couple of really good explanations of the process.
stack overflow ( https://bit.ly/47xx3S0 )
blog post ( https://bit.ly/3H9myJJ )
unfortunately that blog post going through the specifics of creating /etc/qemu/bridge.conf explicitly sets readability of the file to 640. AND thanks to bad error handling in virt-manager i was being told when trying to start the domain.
"Error starting domain: 'utf-8' codec can't decode byte 0xab in position 159: invalid start byte"
thankfully i came to my senses and started with virsh start because that got me a helpful error explaining that there was no access to read /etc/qemu/bridge.conf. makes sense if it's not a world readable file and i'm starting the domain in "user mode"...
1 note · View note
guiltiest-gear · 4 months ago
Note
Tumblr media
play of the Devil NOW
I'm fucking trying I prommy but Nvidia hates me because I use linux 💔
4 notes · View notes
comradeprozac · 2 years ago
Text
>Spend 50k in top of the line computer
>Install windows 10
>Install Ubuntu on windows 10 using wsl
>Install ArchLinux on Ubuntu using libvirt/qemu
>Install Docker on Archlinux
>Install windows 2000 on Docker
>Install DosBox on windows 2000
>Install Doom on windows 2000
Experience Doom thru 4 layers of virtualization.
2 notes · View notes
prohoster-info · 8 days ago
Link
0 notes
jtr-taonaw · 5 months ago
Text
It's too easy to get Windows 11 VM on Linux
Yesterday, I mentioned that I will probably set up a Windows virtual machine on my Thelio, My Linux Pop OS desktop. Later, I decided to play around with it, and I was surprised to find out how easy it was to get Windows 11 up and running. I’m surprised. Here are my notes:
Checking requirements
Before we start, we need to make sure our Host—the Linux computer we’re going to install the Windows environment on—has a CPU that supports virtualization. Most modern computers today probably do, but in case you have Linux running on an aging computer, you want to make sure.
To do that, run the command lscpu in the terminal and look under virtualization. It should say VT-X. If it is, you’re ready to go.
Of course, you will also need to get the Windows operating system. Download it from Microsoft and use their official Windows ISO (for this, I used the Windows11 ISO)
Install needed libraries and software
We’re going to install several components needed for virtualization. queue-kvm, the hardware component and the kernel level environment; virt-manager, which is the software and GUI we will be interacting with for configurations; and bridge-utils and libvirt-daemon, which are several components that allow the host to run virtualization as a service and connect your host to your guest virtual machine. We can install them all in one go:
sudo apt install qemu-kvm libvirt-daemon bridge-utils virt-manager
Restart the machine (the host) before continuing, or it will tell you the libvirt service is not available in the next steps.
After restart, verify the service is running with sudo systemctl status libvirtd. It should show as active in green. If not, enable it with sudo systemctl enable libvirtd and start it with sudo systemctl start libvirtd. Then check again.
Next, we also need to add our user to the appropriate groups for access. This is useful:
sudo usermod -aG libvirt $(whoami) and then: sudo usermod -aG kvm $(whoami).
Inside virt-manager
Launch virt-manager from the terminal or find it in your apps.
Select Local install media (ISO image or CDROM) and then Forward.
From the Choose ISO or CDROM install media select Browse and navigate to your downloaded Windows11. Notice that if the ISO is not in the libvirt library (the default location), virt-manager will prompt you for permission to access the location.
To install Windows 11, I used 8 GB of RAM, 8 CPU Cores, and 50 GB of storage (the minimum is 64GB, I’m not sure how I passed this, but you’d probably want more than that anyway). Finish and launch the virtual machine.
When launched, the virt-manager boot will prompt to “press any key to boot from CD-ROM,” so don’t forget to press something before looking into why it doesn’t work like I did…
The Windows 11 installer will locate the disk. Go ahead and install there, it’s the only virtual location you have if you followed the above example. Then it will ask you the usual nonsense (agree to terms, Language, keyboard layout,etc). Note: I always choose Windows 11 Pro, because home version doesn’t come with needed utilities.
Sharing common clipboard
Next, we want to install Spice-VDA, which enables us to copy-paste from the Guest to the Host and vice versa.
Install what’s needed on your Host with sudo apt install spice-vdagent.
On your Guest (in Windows), go to https://spice-space.org/download.html to get the Windows guest tools binary
We also need to install the Windows VirtIO Drivers ISO from https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers ISO on the Host. Download the latest release from under Installtion and then “download the latest stable” link.
On your host, switch to the virtual machine’s configuration (choose the little “i” from the top bar) and select your VM’s CDROM configuration. Browse to the ISO you downloaded above to mount it.
Switch back to your Guest (select the display icon to the right of the “i”). Windows will detect the CD and ask you what to do. Select to browse the files, locate the 64-bit installer, and install.
Leave all options as is.
Restart the guest, and you’re done. Copy-paste should now work
Next, I want to set up a share between the Guest and the Host, but this is not urgent. It seems the easiest way to do it is to create a shared SMB folder from the Guest.
I know that in the past, I had to work harder to get Windows to work, and I still ran into some issues. The setup here took me maybe one hour and no more than two head scratches. It was easy, too easy, and I’m not sure how much of it was because of my hardware and how much because of what’s now included in the virtualization libraries… but it works. I already installed Photoshop, and it works perfectly in Linux, just as it should.
0 notes
portalnetbe · 7 months ago
Text
Instalacja i konfiguracja KVM na Linuksie
Tumblr media
Instalacja i konfiguracja KVM na Linuksie
Wstęp: KVM (Kernel-based Virtual Machine) to technologia wirtualizacji typu open-source, która umożliwia uruchamianie wielu wirtualnych maszyn (VM) na jednym fizycznym serwerze. KVM działa jako moduł jądra Linuksa, co zapewnia wysoką wydajność i stabilność wirtualnych maszyn.
Tumblr media
Instalacja i konfiguracja KVM na Linuksie Wymagania: Serwer z systemem operacyjnym Linux (np. Ubuntu, Debian, CentOS) Włączona wirtualizacja w BIOS-ie (VT-x/AMD-V) Uprawnienia administratora Instalacja KVM: 1. Sprawdzenie wersji jądra: uname -r Upewnij się, że wersja jądra jest powyżej 2.6.20. 2. Instalacja pakietów KVM: Polecenia różnią się w zależności od dystrybucji Linuksa. Przykład dla Ubuntu: sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils 3. Dodanie użytkownika do grupy libvirt: sudo usermod -aG libvirt $USER 4. Uruchomienie demona libvirtd: sudo systemctl start libvirtd 5. Weryfikacja instalacji: virsh list --all Powinno wyświetlić się pusta lista. Konfiguracja KVM: 1. Tworzenie wirtualnej maszyny: virsh create vm.xml Zastąp vm.xml nazwą pliku XML z konfiguracją wirtualnej maszyny. Przykładowy plik XML: XML vm1 4096 1 hvm /usr/bin/qemu-system-x86_64 2. Uruchamianie wirtualnej maszyny: virsh start vm1 3. Podłączanie się do wirtualnej maszyny: virsh console vm1 4. Zarządzanie wirtualnymi maszynami: virsh list --all: wyświetla listę wszystkich wirtualnych maszyn virsh start vm1: uruchamia wirtualną maszynę vm1 virsh stop vm1: zatrzymuje wirtualną maszynę vm1 virsh reboot vm1: restartuje wirtualną maszynę vm1 virsh delete vm1: usuwa wirtualną maszynę vm1 Dodatkowe informacje: Dokumentacja KVM: https://www.linux-kvm.org/page/Documents Poradniki KVM: https://www.amazon.com/Mastering-KVM-Virtualization-virtualization-solutions/dp/1838828710 Narzędzia do zarządzania wirtualnymi maszynami KVM: https://www.linux-kvm.org/page/Management_Tools Podsumowanie: KVM to potężna technologia wirtualizacji, która może pomóc Ci zmaksymalizować wydajność serwera, obniżyć koszty IT i zwiększyć elastyczność infrastruktury. Instalacja i konfiguracja KVM jest stosunkowo prosta i może zostać wykonana przez każdego, kto posiada serwer Linux. Uwaga: Pamiętaj, aby dostosować konfigurację wirtualnej maszyny do swoich potrzeb. Powyższy przykład jest tylko punktem wyjścia. Read the full article
0 notes
qcsdslabs · 7 months ago
Text
OpenShift Virtualization Architecture: Inside KubeVirt and Beyond
OpenShift Virtualization, powered by KubeVirt, enables organizations to run virtual machines (VMs) alongside containerized workloads within the same Kubernetes platform. This unified infrastructure offers seamless integration, efficiency, and scalability. Let’s delve into the architecture that makes OpenShift Virtualization a robust solution for modern workloads.
The Core of OpenShift Virtualization: KubeVirt
What is KubeVirt?
KubeVirt is an open-source project that extends Kubernetes to manage and run VMs natively. By leveraging Kubernetes' orchestration capabilities, KubeVirt bridges the gap between traditional VM-based applications and modern containerized workloads.
Key Components of KubeVirt Architecture
Virtual Machine (VM) Custom Resource Definition (CRD):
Defines the specifications and lifecycle of VMs as Kubernetes-native resources.
Enables seamless VM creation, updates, and deletion using Kubernetes APIs.
Virt-Controller:
Ensures the desired state of VMs.
Manages operations like VM start, stop, and restart.
Virt-Launcher:
A pod that hosts the VM instance.
Ensures isolation and integration with Kubernetes networking and storage.
Virt-Handler:
Runs on each node to manage VM-related operations.
Communicates with the Virt-Controller to execute tasks such as attaching disks or configuring networking.
Libvirt and QEMU/KVM:
Underlying technologies that provide VM execution capabilities.
Offer high performance and compatibility with existing VM workloads.
Integration with Kubernetes Ecosystem
Networking
OpenShift Virtualization integrates with Kubernetes networking solutions, such as:
Multus: Enables multiple network interfaces for VMs and containers.
SR-IOV: Provides high-performance networking for VMs.
Storage
Persistent storage for VMs is achieved using Kubernetes StorageClasses, ensuring that VMs have access to reliable and scalable storage solutions, such as:
Ceph RBD
NFS
GlusterFS
Security
Security is built into OpenShift Virtualization with:
SELinux: Enforces fine-grained access control.
RBAC: Manages access to VM resources via Kubernetes roles and bindings.
Beyond KubeVirt: Expanding Capabilities
Hybrid Workloads
OpenShift Virtualization enables hybrid workloads by allowing applications to:
Combine VM-based legacy components with containerized microservices.
Transition legacy apps into cloud-native environments gradually.
Operator Framework
OpenShift Virtualization leverages Operators to automate lifecycle management tasks like deployment, scaling, and updates for VM workloads.
Performance Optimization
Supports GPU passthrough for high-performance workloads, such as AI/ML.
Leverages advanced networking and storage features for demanding applications.
Real-World Use Cases
Dev-Test Environments: Developers can run VMs alongside containers to test different environments and dependencies.
Data Center Consolidation: Consolidate traditional and modern workloads on a unified Kubernetes platform, reducing operational overhead.
Hybrid Cloud Strategy: Extend VMs from on-premises to cloud environments seamlessly with OpenShift.
Conclusion
OpenShift Virtualization, with its KubeVirt foundation, is a game-changer for organizations seeking to modernize their IT infrastructure. By enabling VMs and containers to coexist and collaborate, OpenShift bridges the past and future of application workloads, unlocking unparalleled efficiency and scalability.
Whether you're modernizing legacy systems or innovating with cutting-edge technologies, OpenShift Virtualization provides the tools to succeed in today’s dynamic IT landscape.
For more information visit: https://www.hawkstack.com/
0 notes
qcs01 · 1 year ago
Text
Becoming a Red Hat Enterprise Linux (RHEL) Expert: Your Path to Mastery and Market Value
In the rapidly evolving landscape of IT, specialization in specific technologies can set you apart and significantly boost your market value. For system administrators and IT professionals, mastering Red Hat Enterprise Linux (RHEL) is a strategic move that can open doors to numerous career opportunities. Here’s a comprehensive guide to becoming a RHEL expert, highlighting the key certifications and the technologies they cover.
1. Red Hat Certified System Administrator (RHCSA) - EX200
The journey to becoming a RHEL expert begins with the RHCSA certification. This foundational certification is designed to ensure you have the essential skills required for basic system administration tasks.
Key Technologies Covered:
System Configuration and Management: Install and configure software, manage basic networking, and set up local storage.
User and Group Management: Create and manage user and group accounts, implement security policies, and manage user privileges.
File System Management: Understand and manage file systems and permissions, including configuring and mounting file systems.
Achieving the RHCSA certification demonstrates your ability to perform essential system administration tasks across a wide variety of environments and deployment scenarios.
2. Red Hat Certified Engineer (RHCE) - EX294
Building on the RHCSA, the RHCE certification focuses on automation and DevOps skills. This certification is ideal for those looking to advance their ability to manage and automate Red Hat Enterprise Linux systems.
Key Technologies Covered:
Automation with Ansible: Install and configure Ansible, create and manage Ansible playbooks, and use Ansible to automate system configuration and management tasks.
Shell Scripting and Command Line Automation: Develop and execute shell scripts, understand and use Bash and other scripting languages to automate routine tasks.
System Security: Implement advanced security measures, manage SELinux policies, and ensure compliance with security standards.
The RHCE certification is a testament to your ability to automate Red Hat Enterprise Linux tasks, streamlining operations, and increasing efficiency.
3. Red Hat Certified Specialist in Security: Linux (EX415)
For those with a keen interest in security, the Red Hat Certified Specialist in Security certification validates your ability to secure RHEL systems.
Key Technologies Covered:
SELinux: Configure and manage Security-Enhanced Linux (SELinux) policies and contexts to secure a Red Hat system.
Firewall Management: Set up and manage firewalls using firewalld and other related tools.
Cryptography: Implement and manage encryption techniques, including GPG and SSL/TLS, to secure data in transit and at rest.
This certification highlights your expertise in hardening and securing Red Hat Enterprise Linux environments, making you an invaluable asset in any organization’s security framework.
4. Red Hat Certified Specialist in Virtualization (EX318)
Virtualization is a critical component of modern IT infrastructure. The Red Hat Certified Specialist in Virtualization certification proves your skills in managing virtualized environments.
Key Technologies Covered:
KVM and libvirt: Install and configure Kernel-based Virtual Machine (KVM) and manage virtual machines using libvirt.
Virtual Network Configuration: Set up and manage virtual networks, ensuring optimal performance and security.
Storage Management for Virtualization: Configure and manage storage for virtual machines, including iSCSI and NFS.
With this certification, you can demonstrate your ability to deploy and manage virtualized environments, a crucial skill in today’s IT landscape.
5. Red Hat Certified Specialist in OpenShift Administration (EX280)
As containerization and Kubernetes become mainstream, proficiency in Red Hat OpenShift is increasingly valuable. The Red Hat Certified Specialist in OpenShift Administration certification validates your skills in managing Red Hat’s Kubernetes-based container platform.
Key Technologies Covered:
OpenShift Installation and Configuration: Install, configure, and manage OpenShift clusters.
Container Management: Deploy, manage, and troubleshoot containerized applications.
OpenShift Security: Implement security best practices in an OpenShift environment, including user management and role-based access control.
This certification ensures you are equipped to manage and deploy applications in a cloud-native environment, aligning with modern DevOps practices.
Conclusion
Embarking on the Red Hat Enterprise Linux Expert Track is a strategic move for any IT professional. Each certification builds on the previous one, gradually enhancing your skills and knowledge. By achieving these certifications, you position yourself as a highly skilled and marketable expert in RHEL technologies.
Whether you’re starting with basic system administration or moving towards advanced automation, security, virtualization, or containerization, the Red Hat certification path provides a clear and rewarding route to career advancement. Invest in your future by becoming a Red Hat Enterprise Linux expert and unlock a world of opportunities in the IT industry.
For more details click www.qcsdclabs.com
0 notes
gslin · 1 year ago
Text
0 notes
21thailandserv · 2 years ago
Text
Is a Bangkok VPS VM Available?
If you’re looking for more power than shared hosting but can’t afford a dedicated server, consider Thailand VPS. This type of web hosting offers a lot of benefits, including high speed connectivity and unlimited bandwidth.
VPS also provides you with root access to your server, allowing you to install software and programs as you please. This is a huge advantage over shared hosting, which limits your flexibility and control.
KVM a VM
KVM is an open-source hypervisor that works with Linux. It offers many benefits, including performance and cost savings. It also has a large community. Its source code is available, which means that it’s easy to fix issues. It’s also possible to use a paid version of the hypervisor with technical support. There are several versions of the software for managing KVM VMs, but the most popular is libvirt.
Unlike VMware, KVM doesn’t require an underlying OS to virtualize hardware. Its bare metal architecture gives it an inherent performance advantage over other hypervisors. It also supports a wide range of certified Linux hardware platforms and enables kernel same-page merging. It also uses the qcow2 disk image format, which supports zlib-based compression and optional AES encryption.
The KVM virtual machine is an ideal solution for developers who want to run multiple websites on one server. This feature allows them to increase the functional capacity of their sites and improve website speed. It also helps them to create a secure environment for their websites.
To manage a KVM VM, you can use virt-manager, which is a graphical application for connecting to and configuring a KVM host. virt-manager is available for Windows, MacOS, and Linux. It can be used to connect to a VM, edit its settings, and clone it. It can also be used to perform VM live migration.
InterWorx Control Panel
InterWorx is a control panel software for servers that makes it simpler for web site users and system administrators to supervise operations on their websites, servers, and domains. It also offers tools for high availability and server clustering. There are two main sections of the platform: NodeWorx and SiteWorx.
Unlike cPanel, which uses a traditional UI, InterWorx focuses on functionality and performance. Its sleek interface is easy to navigate, and its features are well documented. It is also available in multiple languages. It has many useful plugins for Webalizer, AWStats and Analog, which help with monitoring and analysis. It is also easy to install WordPress.
In addition, InterWorx provides a number of useful features that are not available in other control panels, such as disk usage quotas and the ability to set up password-protected directories. It is also able to automatically renew SSL certificates, ensuring that all of your website’s visitors have a secure connection.
Another important feature of the platform is its ability to manage multiple reseller accounts. This allows you to resell your server space to multiple users and create their own SiteWorx accounts. This feature is especially helpful for developers and end users who use their sites to host other websites. It is easy to customize and configure the account settings for each user.
1Gbps High Performance Connections
Bangkok web hosting is a highly flexible type of web hosting. It is ideal for users who want more scalability, security, and backup resources than a Shared Server or dedicated server can offer. The VPS server also offers high-end hardware for faster performance. This type of server can be used to host a variety of applications, including document serving and website rendering. It is also suitable for gamers who want to play online games.
While a VPS isn’t an actual physical server, it does have a lot of power and can handle high traffic websites. This type of hosting is more stable and reliable than shared hosting plans, but it can also be more expensive than a bare metal server. VPS hosting is often a better option for medium-sized businesses that can’t afford a dedicated server.
The VPS server in Thailand also allows for complete root access, meaning that you can install your own software and programs. This is especially useful for webmasters who want to run multiple websites on one server. It also allows you to reboot the server without affecting any other programs or websites. This flexibility makes it a popular choice for small and mid-sized business owners. It is also cheaper than a dedicated server and more scalable. It is also ideal for businesses with remote offices and locations around the world.
Unlimited Bandwidth
Unlimited bandwidth is one of the key benefits that make economical KVM VPS hosting a compelling choice for businesses of all sizes. This feature is essential for ensuring that visitors to your website can access content quickly without any restrictions or delays. Bandwidth is a measure of the amount of data that can be relayed between your website and its visitors in a given time period.
TheServerHost offers a variety of plans for its VPS hosting services. All of these plans come with unmetered bandwidth and disk space. This means that you can host a high-traffic website without incurring any overage charges. Moreover, these plans offer full root access. This allows you to install software, programs, and applications on your server. This is a big advantage over basic web hosting, where neighboring websites can cause performance issues on your site. VPS servers are a good option for people who cannot afford a dedicated server but need more scalability, security, and backup resources than shared hosting. Using the latest technology, they are designed to provide maximum performance and reliability. They also include a control panel that makes it easy to manage and monitor your server. The control panel is based on InterWorx, which has a wide range of features to make life easier for system administrators and website owners.
1 note · View note
hackernewsrobot · 2 years ago
Text
Why libvirt supports only 14 PCIe hotplugged devices on x86-64
https://dottedmag.net/blog/libvirt-14-pcie-devices/
0 notes
mutter-official · 4 months ago
Text
uhh I'm often one to suggest learning rust, you could also work on vm stuff if you're categorically against docker, proxmox and libvirt and qemu/kvm are always good places to start
anybody got suggestions to do stuff? (i will not be taking "install docker" as a suggestion)
25 notes · View notes
mr-wisecoder · 5 years ago
Text
Установка и настройка QEMU/KVM в Ubuntu
Tumblr media
В этой статье я хочу рассмотреть установку и настройку QEMU/KVM в Ubuntu.
Оглавление
ВведениеПроверка аппаратной поддержкиПодготовка сервераУстановка и запускНастройка сетиНастройка сетевого мостаВиртуальные сети (NAT forwarding)Соз��ание виртуальной машиныУправление виртуальной машиной Введение в QEMU/KVM KVM (Kernel-based Virtual Machine) — это комплекс программ для виртуализации с аппаратной поддержкой в среде Linux x86. Виртуализация позволяет нам устанавливать полностью изолированные, но работающие бок о бок операционные системы на одном и том же железе. Гипервизор KVM представляет из себя загружаемый модуль ядра Linux. Он обеспечивает только уровень абстракции устройств. Таким образом одного гипервизора KVM недостаточно для запуска виртуальной ОС. Нужна еще эмуляция процессора, дисков, сети, видео, шины. Для этого существует QEMU. QEMU (Quick Emulator) — эмулятор различных устройств, который позволяет запускать операционные системы, предназначенные для одной архитектуры, на другой. Обычно такой комплекс программ для виртуализации называют QEMU/KVM. Проверка аппаратной поддержки виртуализации Во-первых, перед настройкой KVM необходимо проверить совместимость сервера с технологиями виртуализации: cat /proc/cpuinfo | egrep -c "(vmx|svx)" Числа отличные от нуля говорят о том, что процессор имеет поддержку аппаратной виртуализации Intel-VT или AMD-V . Подготовка сервера Во-вторых, для удобства создадим каталоги для хранения образов жестких дисков наших виртуальных машин и образов ISO, с которых будет производиться установка операционных систем. sudo mkdir -p /kvm/{hdd,iso} В результате будет создан каталог /kvm/hdd для виртуальных жестких дисков и каталог /kvm/iso для образов ISO. Установка и запуск QEMU/KVM в Ubuntu В качестве интерфейса к технологиии виртуализации QEMU/KVM в Ubuntu мы будем использовать библиотеку libvirt. С помощью следующей команды мы установим гипервизор, эмулятор, библиотеку и утилиты управления. sudo apt-get install qemu-kvm libvirt-bin virtinst libosinfo-bin Где qemu-kvm — сам гипервизор; libvirt-bin — библиотека управления гипервизором; virtinst — утилита управления виртуальными машинами; libosinfo-bin — утилита для просмотра списка вариантов гостевых операционных систем. После успешной установки всех пакетов настроим автоматический запуск сервиса. sudo systemctl enable libvirtd Запустим его. sudo systemctl start libvirtd Пользователя, под которым будем работать с виртуальными машинами, включим в группу libvirt: sudo usermod -aG libvirt user И установим права доступа на ранее созданные каталоги: sudo chgrp libvirt /kvm/{hdd,iso} sudo chmod g+w /kvm/hdd Настраивать виртуальные машины, хранилища и сети можно как из командной строки, так и с помощью GUI-инструмента virt-manager. Причем установить его можно как на сервер, так и на другой компь��тер, например, на ваш ноутбук. В последнем случае вам придется добавить удаленное соединение к libvirt. Установку virt-manager и работу при помощи него с libvirt и виртуальными машинами мы рассмотрим в следующей статье. Настройка сети Итак, виртуальные машины могут работать через свою виртуальную сеть с NAT или получать IP-адреса из локальной сети через сетевой мост, который нам необходимо настроить. Настройка сетевого моста В старых версиях Ubuntu большая часть настроек конфигурации сети Ethernet находится в файле /etc/network/interfaces. На всякий случай создадим его резервную копию: mkdir -p ~/backup && sudo cp /etc/network/interfaces ~/backup Затем устанавливаем утилиты для конфигурирования Ethernet-моста: sudo apt-get install bridge-utils Открываем файл /etc/network/interfaces в своем любимом редакторе (vim, nano): sudo vim /etc/network/interfaces И приводим его к примерно такому виду: source /etc/network/interfaces.d/* auto lo iface lo inet loopback #allow-hotplug eno1 #iface eno1 inet static # address 192.168.7.2/24 # gateway 192.168.7.1 # dns-nameservers 127.0.0.1 192.168.7.1 8.8.8.8 # dns-search home.lan auto br0 iface br0 inet static address 192.168.7.2/24 gateway 192.168.7.1 bridge_ports eno1 bridge_stp on bridge_fd 2 bridge_hello 2 bridge_maxage 20 dns-nameservers 127.0.0.1 192.168.7.1 8.8.8.8 dns-search home.lan Все, что закомментировано — старые настройки сети; br0 — название интерфейса создаваемого моста; eno1 — сетевой интерфейс, через который будет работать мост. Если вы получаете адрес динамически через DHCP, то конфигурация сократится до такой: source /etc/network/interfaces.d/* auto lo iface lo inet loopback auto br0 iface br0 inet dhcp bridge_ports eno1 bridge_stp on bridge_fd 2 bridge_hello 2 bridge_maxage 20 Внимательно проверяем конфигурацию и перезапускаем службу сети: sudo systemctl restart networking Начиная с релиза Ubuntu 17.10, для управления конфигурацией сети по умолчанию используется утилита Netplan, которая добавляет новый уровень абстракции при настройке сетевых интерфейсов. Конфигурация сети хранится в файлах формата YAML. Предоставляется эта информация бэкендам (network renderers), таким как NetworkManager или systemd-networkd. Файлы конфигурации Netplan хранятся в папке /etc/netplan. Для настройки сети открываем в редакторе файл 01-netcfg.yaml vim /etc/netplan/01-netcfg.yaml и приводим его к такому виду: network: version: 2 renderer: networkd ethernets: ens3: dhcp4: false dhcp6: false bridges: br0: dhcp4: false dhcp6: false interfaces: addresses: gateway4: 192.168.7.1 nameservers: search: addresses: parameters: stp: true forward-delay: 2 hello-time: 2 max-age: 20 Ну а при использовании динамической адресации файл конфигурации будет выглядеть так: network: version: 2 renderer: networkd ethernets: ens3: dhcp4: false dhcp6: false bridges: br0: dhcp4: true dhcp6: true interfaces: parameters: stp: true forward-delay: 2 hello-time: 2 max-age: 20 В файлах конфигурации указываем свои адреса, имена интерфейсов и доменов и после тщательной проверки применяем сетевые настройки: sudo netplan apply Виртульные сети (NAT forwarding) Каждая стандартная установка libvirt обеспечивает подключение виртуальных машин на основе NAT из коробки. Это так называемая виртуальная сеть по умолчанию. Вы можете проверить, что она доступна таким образом: sudo virsh net-list --all Name State Autostart Persistent ---------------------------------------------------------- default active yes yes Для того, чтобы виртуальные машины с сетевым интерфейсом NAT могли выходить в интернет необходимо настроить перенаправление сетевого трафика. Для этого надо убрать комментарий строки #net.ipv4.ip_forward=1 в файле /etc/sysctl.d/99-sysctl.conf и сохранить настройки: sudo vim /etc/sysctl.d/99-sysctl.conf sudo sysctl -p /etc/sysctl.d/99-sysctl.conf Создание виртуальной машины Для создания виртуальной машины нам понадобятся две утилиты: osinfo-query — для получения списка доступных для установки вариантов операционных систем и virt-install — непосредственно для самой установки. Итак, создадим нашу первую виртуальную виртуальную машину с ОС Ubuntu 16.04, 1024MiB ОЗУ, 1 процессором, сетью через мост и 12GiB жестким диском. sudo virt-install \ --name ubuntu1604s \ --os-type=linux --os-variant=ubuntu16.04 \ --vcpus=1 \ --ram 1024 \ --network network=bridge:br0 \ --disk path=/kvm/hdd/ubuntu1604s.qcow2,format=qcow2,size=12,bus=virtio \ --cdrom=/kvm/iso/ubuntu-16.04.6-server-amd64.iso \ --graphics vnc,listen=0.0.0.0 --noautoconsole \ --hvm --virt-type=kvm Обратите внимание на параметр --os-variant. Он указывает гипервизору под какую именно ОС следует адаптировать настройки. Список доступных вариантов можно получить, выполнив команду: osinfo-query os Подробнее с параметрами virt-install вы можете ознакомиться на страницах руководства, а я приведу команду создания ВМ c сетью через NAT: sudo virt-install \ --name ubuntu1604s \ --os-type=linux --os-variant=ubuntu16.04 \ --autostart \ --vcpus=2 --cpu host --check-cpu \ --ram 2048 \ --network network=default,model=virtio \ --disk path=/kvm/vhdd/ubuntu1604s.qcow2,format=qcow2,size=12,bus=virtio \ --cdrom=/kvm/iso/ubuntu-16.04.6-server-amd64.iso \ --graphics vnc,listen=0.0.0.0,password=vncpwd --noautoconsole \ --hvm --virt-type=kvm После запуска установки в консоли сервера вы увидите текст похожий на этот: Domain installation still in progress. Waiting for installation to complete. Значит все нормально и для продолжения установки ОС в виртуальной машине нам нужно соединиться к ней по VNC. Чтобы узнать номер порта на котором он поднят для нашей ВМ откройте новую консоль или в текущей переведите задание в фоновый режим с помощью CTRL+Z, bg и выполните команду: sudo virsh dumpxml ubuntu1604s | grep graphics В моем случае это порт 5903: или выполнив команду sudo virsh vncdisplay ubuntu1604s вы получите примерно такой результат: :3 Это число нужно сложить с базовым портом 5900. Далее подключ��емся с помощью клиента VNC (Remmina, TightVNC) к нашему серверу по полученному порту и устанавливаем Ubuntu 16.04 в нашей ВМ.
Tumblr media
После успешного завершения установки в консоли вы увидите примерно следующее: Domain has shutdown. Continuing. Domain creation completed. Restarting guest. Управление виртуальной машиной Для управления гостевыми системами и гипервизором существует текстовая утилита virsh. Она использует libvirt API и служит альтернативой графическому менеджеру виртуальных машин virt-manager. Я коснусь только основных команд управления ВМ, так как описание всех возможностей утилиты — тема для отдельной статьи. Список всех доступных команд вы можете увидеть так: virsh help Описание параметров отдельной команды: virsh help command где command — это команда из списка, который мы получили выше. Для просмотра списка всех виртуальных машин используйте: sudo vish list --all Вот что она показала у меня: Id Name State ---------------------------------------------------- 1 ubuntu16 running 3 centos8 running 6 ubuntu18 running 10 ubuntu1604server running - win10 shut off - win2k16 shut off - win2k16-2 shut off - win7 shut off Если же вам нужны только работающие в данный момент виртуалки, то введите: sudo virsh list Для запуска виртуальной машины выполните в консоли: sudo virsh start domain где domain — имя виртуальной машины из списка, который мы получили выше. Для выключения: sudo virsh shutdown domain И для ее перезагрузки: sudo virsh reboot domain Редактирование конфигурации ВМ: sudo virsh edit domain Read the full article
1 note · View note
fabiobuda · 6 years ago
Text
Libvirt KVM high CPU usage with USB attached device
Today I have needed to attach permanently an USB device to a Linux Virtual machine hosted on Ubuntu 18.04 running on KVM hypervisor.
All works fine except that the CPU usage on the Host was oddly high even if the Guest OS was idle.
The CPU usage on Host was always over 12% that is very high if at the same time the Guest is doing nothing. I mean that while the Guest CPU was between 0% and 2% the Host thread was between 12% and 15%.
The only apparent solution found was switching 'hpet' timer from 'no' to 'yes' as discussed in a thread on the Proxmox Forum.
But it didn't the trick (it was related to Windows Guest).
The solution
At the end I found that switching the controller USB model from USB2 to USB3 changed the scenario making Host CPU usage (when Guest is idle) between 2% and 5% that is definitely acceptable. So easy!
2 notes · View notes
nixcraft · 7 years ago
Link
2 notes · View notes
portalnetbe · 7 months ago
Text
Zalety i wady wirtualizacji: KVM, QEMU, libvirt i virt-manager
Tumblr media
Zalety i wady wirtualizacji: KVM, QEMU, libvirt i virt-manager
Wstęp: Wirtualizacja to technologia, która umożliwia uruchamianie wielu systemów operacyjnych na jednym fizycznym serwerze. Istnieje wiele różnych narzędzi do wirtualizacji, a każdy z nich ma swoje zalety i wady. W tym artykule omówimy KVM, QEMU, libvirt i virt-manager, a także porównamy ich zalety i wady.
Tumblr media
Zalety i wady wirtualizacji: KVM, QEMU, libvirt i virt-manager KVM: Zalety: Open-source Wysoka wydajność Łatwość konfiguracji Bezpośredni dostęp do sprzętu Wady: Brak graficznego interfejsu użytkownika Wymaga znajomości poleceń CLI QEMU: Zalety: Open-source Szeroki zakres obsługiwanych platform Możliwość emulacji różnych typów maszyn Graficzny interfejs użytkownika (opcjonalnie) Wady: Mniejsza wydajność niż KVM Bardziej skomplikowana konfiguracja libvirt: Zalety: Open-source Potężne API do zarządzania wirtualnymi maszynami Obsługa wielu różnych narzędzi do zarządzania Wady: Brak graficznego interfejsu użytkownika Wymaga znajomości API virt-manager: Zalety: Graficzny interfejs użytkownika Łatwość użycia Obsługa wielu różnych platform wirtualizacyjnych Wady: Mniej funkcji niż libvirt Niektóre funkcje dostępne tylko z wiersza poleceń Porównanie: Narzędzie Zalety Wady KVM Wysoka wydajność, łatwość konfiguracji Brak GUI QEMU Szeroki zakres obsługiwanych platform, GUI (opcjonalnie) Mniejsza wydajność libvirt Potężne API, obsługa wielu narzędzi Brak GUI virt-manager Łatwość użycia, obsługa wielu platform Mniej funkcji Podsumowanie: Wybór odpowiedniego narzędzia do wirtualizacji zależy od Twoich potrzeb. KVM to dobry wybór, jeśli potrzebujesz wysokiej wydajności i łatwości konfiguracji. QEMU jest dobrym wyborem, jeśli potrzebujesz szerokiego zakresu obsługiwanych platform. Libvirt to dobry wybór, jeśli potrzebujesz potężnego API do zarządzania wirtualnymi maszynami. Virt-manager to dobry wybór, jeśli potrzebujesz łatwego w użyciu narzędzia z graficznym interfejsem użytkownika. Dodatkowe informacje: Strona internetowa KVM: https://www.linux-kvm.org/ Strona internetowa QEMU: https://www.qemu.org/ Strona internetowa libvirt: https://libvirt.org/ Strona internetowa virt-manager: https://virt-manager.org/ Read the full article
0 notes