Re: [Qemu-discuss] Run qemu with /dev/sda ?
On 18 April 2016 at 20:17, Ran Shalit wrote: > I probably have some misunderstanding with running qemu. > I see in the following link: > http://www.osadl.org/Use-BuildRoot-to-create-a-Linux-image-fo.buildroot-qemu.0.html > that qemu should be run as following: > > KERNEL="bzImage" > DISK="rootfs.i686.ext2" > > qemu-system-i386 -kernel $LOCATION/$KERNEL \ > -hda $LOCATION/$DISK \ > -boot c \ > -m 128 \ > -append "root=/dev/sda rw" \ > -localtime \ > -no-reboot \ > -name rtlinux \ > -net nic -net user \ > -redir tcp:::22 \ > -redir tcp::: > > But how can it be that qemu use the same disk as the host ? > Isn't it dangerous ? QEMU isn't using the same disk as the host: this command line says "your first hard disk should be emulated using the rootfs.i686.ext2 image file". So the guest won't be making raw accesses to the same hard disk the host is using. thanks -- PMM
Re: [Qemu-discuss] Run qemu with /dev/sda ?
On Mon, Apr 18, 2016 at 10:36 PM, Peter Maydell wrote: > On 18 April 2016 at 20:17, Ran Shalit wrote: >> I probably have some misunderstanding with running qemu. >> I see in the following link: >> http://www.osadl.org/Use-BuildRoot-to-create-a-Linux-image-fo.buildroot-qemu.0.html >> that qemu should be run as following: >> >> KERNEL="bzImage" >> DISK="rootfs.i686.ext2" >> >> qemu-system-i386 -kernel $LOCATION/$KERNEL \ >> -hda $LOCATION/$DISK \ >> -boot c \ >> -m 128 \ >> -append "root=/dev/sda rw" \ >> -localtime \ >> -no-reboot \ >> -name rtlinux \ >> -net nic -net user \ >> -redir tcp:::22 \ >> -redir tcp::: >> >> But how can it be that qemu use the same disk as the host ? >> Isn't it dangerous ? > > QEMU isn't using the same disk as the host: this command line > says "your first hard disk should be emulated using the > rootfs.i686.ext2 image file". So the guest won't be making > raw accesses to the same hard disk the host is using. > So I should expect the file rootfs.i686.ext2 to be modified every time after doing something in guest OS, Right ? I mean that writing to root filesystem will result in slightly different in rootfs.i686.ext2 after quiting qemu. Thanks, Ran
Re: [Qemu-discuss] Run qemu with /dev/sda ?
Right; guest write operations will affect only $DISK pointed file. El 18/04/16 a les 21:42, Ran Shalit ha escrit: > On Mon, Apr 18, 2016 at 10:36 PM, Peter Maydell > wrote: >> On 18 April 2016 at 20:17, Ran Shalit wrote: >>> I probably have some misunderstanding with running qemu. >>> I see in the following link: >>> http://www.osadl.org/Use-BuildRoot-to-create-a-Linux-image-fo.buildroot-qemu.0.html >>> that qemu should be run as following: >>> >>> KERNEL="bzImage" >>> DISK="rootfs.i686.ext2" >>> >>> qemu-system-i386 -kernel $LOCATION/$KERNEL \ >>> -hda $LOCATION/$DISK \ >>> -boot c \ >>> -m 128 \ >>> -append "root=/dev/sda rw" \ >>> -localtime \ >>> -no-reboot \ >>> -name rtlinux \ >>> -net nic -net user \ >>> -redir tcp:::22 \ >>> -redir tcp::: >>> >>> But how can it be that qemu use the same disk as the host ? >>> Isn't it dangerous ? >> >> QEMU isn't using the same disk as the host: this command line >> says "your first hard disk should be emulated using the >> rootfs.i686.ext2 image file". So the guest won't be making >> raw accesses to the same hard disk the host is using. >> > > So I should expect the file rootfs.i686.ext2 to be modified every time > after doing something in guest OS, Right ? > I mean that writing to root filesystem will result in slightly > different in rootfs.i686.ext2 after quiting qemu. > > Thanks, > Ran >