Re: how to transfer the image of qemu to real machine

2015-11-04 Thread Tuyosi Takesima
hi all

i  write  **only tentative ** plan .
it perhaps  has  imcompleteness .


URL is
http://openbsd-akita.blogspot.jp/2015/11/export-kvms-image-to-real-machine.html
.

-
regards



Re: how to transfer the image of qemu to real machine

2015-11-04 Thread Tuyosi Takesima
Hi all .
a little progress was made .

from FAQ8
boot> boot -s
# fsck -p / && mount -uw /<--- ok
# fsck -p /usr && mount /usr  <--- fail

touch /etc/spwd.db
and then
i can login  by root .

but login by tuyosi is not possible
so i create user TUYOSI .
then
i can login by TUYOSI .
but i cannot start xfce4 .

i report now state .

regards



Re: how to transfer the image of qemu to real machine

2015-11-04 Thread Stuart Henderson
On 2015-11-04, Tuyosi Takesima  wrote:
> Hi all .
>
> i  use only one PC which is dual boot and has USB HDD(sd1) .
> i  write down my procedures .
>
> 1)on linux machine , i boot openbsd by kvm and follow current .
>   and so the qcow2 image of OpenBSD-current.img was made .
>   and then i copy OpenBSD-current.img to ext2 area .

Can you use qemu-img to convert it to a raw image to dd to the disk?



Re: how to transfer the image of qemu to real machine

2015-11-04 Thread Jan Vlach
Hello Tuyosi,

> 4)/MNT/usr/sbin/installboot sd1

try:
/MNT/usr/sbin/installboot -r /MNT sd1

I've always transferred systems using dump & restore to be on the safe side 
though.



Re: how to transfer the image of qemu to real machine

2015-11-04 Thread Tuyosi Takesima
thanks for kind advices .

i do
1) ssh root@192.168.100.101 "tar czpf - /  | tar xzpf - -C /MNT
and
2) installboot -r /MNT sd1 (on openbsd5.8 = sd0a)
and then
3) boot by grub

perhaps sd1a's current openbsd comes up
because [ /dev/sd1a(655d3964e75dc0cc.a): file system is clean ; not
checking ] apear .

but login passwd is changed .

how to cope with this ?
a little more effort is neeeded .


if completed , i follow current by openbsd of linux's KVM (sd0i),
and i export it via openbsd of openbsd's QEMU (sd0a) to real hard disk
(sd1a) .


-
regards



how to transfer the image of qemu to real machine

2015-11-03 Thread Tuyosi Takesima
Hi all .

i  use only one PC which is dual boot and has USB HDD(sd1) .
i  write down my procedures .

1)on linux machine , i boot openbsd by kvm and follow current .
  and so the qcow2 image of OpenBSD-current.img was made .
  and then i copy OpenBSD-current.img to ext2 area .

2)on openbsd machine ,
  i copy OpenBSD-current.img from ext2 erea fs  to openbsd erea.

  then
  on openbsd
  qemu-system-x86_64 -m 1024 -hda OpenBSD-current.img -net
  nic,vlan=1,model=e1000,macaddr=fe:e1:ba:d3:e7:11 -net tap,vlan=1

  then on this virtual machine
  scp -r / tuyosi@192.168.100.101:/MNT.

  (here mount /dev/sd1a /MNT ; chown tuyosi /MNT)

3)rewite /MNT/et/fstab
  /dev/sd1a / ffs rw 1 1

4)/MNT/usr/sbin/installboot sd1

but i cannot boot openbsd of sd1 .
there must be wrongs especially about innstalling boot loader .

please show them .
---
regards



Re: how to transfer the image of qemu to real machine

2015-11-03 Thread Chris Cappuccio
Tuyosi Takesima [nakajin.fu...@gmail.com] wrote:

> 1)on linux machine , i boot openbsd by kvm and follow current .
>   and so the qcow2 image of OpenBSD-current.img was made .
>   and then i copy OpenBSD-current.img to ext2 area .

You are creating the filesystem layout under linux and then putting the
result into openbsd to run installboot? I'm not sure how well that is going
to work. How are you creating device nodes? Kernels? binaries?

> 3)rewite /MNT/et/fstab
>   /dev/sd1a / ffs rw 1 1

At a minimum this needs to be sd0a as this disk will become sd0 when you
move it to the destination system. This is an uphill battle.



Re: how to transfer the image of qemu to real machine

2015-11-03 Thread Benny Lofgren
Hello Tuyosi,

On 2015-11-04 03:38, Tuyosi Takesima wrote:
> i  use only one PC which is dual boot and has USB HDD(sd1) .
> i  write down my procedures .
> 
> 1)on linux machine , i boot openbsd by kvm and follow current .
>   and so the qcow2 image of OpenBSD-current.img was made .
>   and then i copy OpenBSD-current.img to ext2 area .
> 
> 2)on openbsd machine ,
>   i copy OpenBSD-current.img from ext2 erea fs  to openbsd erea.
> 
>   then
>   on openbsd
>   qemu-system-x86_64 -m 1024 -hda OpenBSD-current.img -net
>   nic,vlan=1,model=e1000,macaddr=fe:e1:ba:d3:e7:11 -net tap,vlan=1
> 
>   then on this virtual machine
>   scp -r / tuyosi@192.168.100.101:/MNT.
> 
>   (here mount /dev/sd1a /MNT ; chown tuyosi /MNT)
> 
> 3)rewite /MNT/et/fstab
>   /dev/sd1a / ffs rw 1 1
> 
> 4)/MNT/usr/sbin/installboot sd1
> 
> but i cannot boot openbsd of sd1 .
> there must be wrongs especially about innstalling boot loader .
> 
> please show them .


This is how I understand what you want to do. Please correct me if I
have misunderstood!


You want to:

1) Move a qcow2 image made in kvm under Linux to run under qemu on OpenBSD?

2) Make a real machine from your virtual machine, by:

3) Copying the files from the qemu image to a physical USB disk that you
have on /dev/sd1 on your real machine?

That should be possible to do.


If I understand you, this works:

1) You can make it boot with qemu on OpenBSD

2) You are logging in to your virtual machine.


Then you want to:

1) Make your sd1 disk bootable

2) Copy everything from OpenBSD/qemu to /dev/sd1a on your real machine?



This is where things are going wrong.

1) How have you set up the sd1 disk? Have you done fdisk / disklabel /
newfs on the partitions you want to use?

   * It looks like you are only using one partition for the whole system.
 That works, but it is not the recommended practice.

2) When you are copying your virtual machine, you are using scp -r.

   * This destroys ownership, groups, permissions and time stamps on the
files you are copying!

   * It will not work!

   * You need to use another way to copy the files so the metadata of
EVERY FILE is safe.

   * You need to be root in both the virtual machine and your real
machine for everything to work.

   I often use this way:

   virt_machine# cd /; tar cfz - | ssh root@real_machine "cd /MNT; tar
xvfpz -"


3) How do you want to boot the new real machine?

   * If you want to leave the USB disk where it is on your machine and
boot from there, then changing to /dev/sd1a in /dev/fstab is good.
 You will need to use a command on the boot prompt when your machine
boots, if not it will start from /dev/sd0a instead:

 boot> boot sd1a:/bsd

   * If you are going to move the disk to a new machine, change to
/dev/sd0a instead.

   * Does your installboot command work? If not, what message do you get?


If it still does not work you can help us to help you if you put the
output from the failed boot in your mail.

Also include the dmsg from the machine you are trying to run it on, if
you can.

If it is too much to write down, take pictures with your phone or a
camera of the screen and put it online somewhere, and add a link to it
in your mail.



I hope this helps. I am sorry if my language is hard to understand.
Please ask if you do not understand my English!




Regards,

/Benny



Re: how to transfer the image of qemu to real machine

2015-11-03 Thread Tuyosi Takesima
thanks for advices .

i rewrite /MNT/etc/fstab concerning [disklabel sd1]

9f39539222428a90.b none swap sw
#9f39539222428a90.a / ffs rw 1 1
# duid: 655d3964e75dc0cc
655d3964e75dc0cc.a / ffs rw 1 1


but i cannot boot sd1's openbsd .

# /MNT/usr/sbin/installboot -v sd1 /MNT/usr/mdec/biosboot /MNT/usr/mdec/boot
Using / as root
installing bootstrap on /dev/rsd1c
using first-stage /MNT/usr/mdec/biosboot, second-stage /MNT/usr/mdec/boot
installboot: disklabel: sd1: Inappropriate ioctl for device
---> fail


# /usr/sbin/installboot -v sd1 /MNT/usr/mdec/biosboot /MNT/usr/mdec/boot
Using / as root
installing bootstrap on /dev/rsd1c
using first-stage /MNT/usr/mdec/biosboot, second-stage /MNT/usr/mdec/boot
copying /MNT/usr/mdec/boot to /boot
installboot: cross-device install
---> cannot boot sd1


chroot /MNT
---> cannot do anythin

namely
i cannot boot sd1's openbsd .
-
follow current by KVM:
http://openbsd-akita.blogspot.jp/2015/10/xenocara.html
qemu:  http://qemuandopenbsd.blogspot.jp/2015/09/qemu.html