KVM folder share, networking, host and guest IP

Create Virtual Machine via KVM

nat

Host IP of KVM, run ifconfig on host

~$ ifconfig 
virbr0    Link encap:Ethernet  HWaddr fe:54:00:ad:73:64  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:588122 errors:0 dropped:0 overruns:0 frame:0
          TX packets:749737 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:31412184 (31.4 MB)  TX bytes:1267281456 (1.2 GB)

Guest IP, run ifconfig on created virtual machine.

~$ ifconfig 
eth0      Link encap:Ethernet  HWaddr 52:54:00:ad:73:64  
          inet addr:192.168.122.112  Bcast:192.168.122.255  Mask:255.255.255.0
          inet6 addr: fe80::5054:ff:fead:7364/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:415799 errors:0 dropped:3 overruns:0 frame:0
          TX packets:252791 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:714784870 (714.7 MB)  TX bytes:17348958 (17.3 MB)

KVM IPs

192.168.122.112 is your virtual machine IP.
192.168.122.1 is your host IP.

We can easy share folder on host to your virtual machine via networking mount.

mount 192.168.122.1:/home /mnt

scp, ssh also can be used too.

Subscribe to Post, Code and Quiet Time.

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe