Install and configure the Linux virtual machine, refer to the blog: https://linux.cn/article-9707-1.html
This article solves the problem that the hard disk cannot be found when the Windows system is installed with the virt-install command to create a Windows virtual machine from the command line. The original code:
sudo virt-install -n windows7-1 --description "ARK single server" --os-type=win --os-variant=win7 --ram=8192 --vcpus=2 --disk path=/home/mingxuexi/images/win7-1.img,bus=virtio,size=60 --network bridge:br0 --accelerate --graphics vnc,listen=0.0.0.0,keymap=en-us --cdrom=/home/mingxuexi/downloads/cn_windows_7_ultimate_with_sp1_x64_dvd_u_677408.iso
Baidu found the problem: There was a problem of no virtio driver when installing Windows 10 virtual machine, which caused the installation program to find the hard disk. You need to download the virtio driver first.
Solution one, add an optical drive (error report, to be resolved):
When creating a virtual machine, add it to the CD-ROM
--cdrom=/home/mingxuexi/downloads/virtio-win.iso
Solution two, add a floppy disk drive (available after testing):
Before we start, we have to prepare a few things:
- Windows installation image
- Virtio ISO and floppy disk image ( CSDN download address )
- Ubuntu 18.04 remote desktop
I am using virtio-win-0.1.141_amd64.vfd version here. The operating system version is: Ubuntu 18.04.1 LTS.
Everything is ready, use the virt-install
command to help create a virtual machine:
The virtual basic configuration information is as follows:
- 2G RAM
- 1 CPU, 1 core, 2 threads
- 1 CDROM (Windows installation CD)
- 60G hard disk (system disk)
- 1 floppy drive (Virtio driver)
- The network has selected bridge mode
sudo virt-install --name win7-2 --memory 2048 --vcpus sockets=1,cores=1,threads=2 --cdrom=/home/mingxuexi/downloads/cn_windows_7_ultimate_with_sp1_x64_dvd_u_677408.iso --os-variant=win7 --disk path=/home/mingxuexi/images/win7-2.img,bus=virtio,size=60 --disk /home/mingxuexi/downloads/virtio-win-0.1.141_amd64.vfd,device=floppy --network bridge=br0,model=virtio --hvm --virt-type kvm
- Load the driver:
- Select floppy drive/amd64/Win7
Solution three
In addition to the above two methods, you can also make a Windows system image integrated with virtio driver for installation, to be continued...
Reference blog: