Monday, February 13, 2023

Import OVA which is created by VMWare to VirtualBox

Notes about the problem I had when trying to import OVA created by VMWare to VirtualBox...

My environment: 
  • Windows 10 pro + VirtualBox v7.0 
    • VirtualBox downgraded to 6.1.26 due to this issue with Wayland
      • Still not fixed with Wayland on old linux guest machine (kernel 2.x)
Failed to import OVA file, error when trying import OVA file (exported by VMWare) to VirtualBox:  
  • VBOX_E_INVALID_OBJECT_STATE (0x80bb0007)
OVA file is just a tar file, so extracted it using 7z, we can see these 3 files:
  • vm-disk1.vmdk: Virtual Disk file
  • vm.mf: checksum data
  • vm.ovf: OVF file, VM definition file
Use "qemu-img" to check "vm-disk1.vmdk" (need to install qemu tool to Windows ):
> qemu-img info vm-disk1.vmdk
image: vm-disk1.vmdk
file format: vmdk
virtual size: 22 GiB (23667847168 bytes)
disk size: 316 MiB
cluster_size: 65536
Format specific information:
    cid: 1377153543
    parent cid: 4294967295
    create type: streamOptimized
    extents:
        [0]:
            compressed: true
            virtual size: 23667847168
            filename: vm-disk1.vmdk
            cluster size: 65536
            format:
Probably  VirtualBox could not handle the "streamOptimized" type or compressed vmdk disk image format. 

Tried  use "qemu-img" to convert it to non-compressed disk image:
> qemu-img convert -f vmdk vm-disk1.vmdk -O vmdk vm-disk1-decompressed.vmdk
    
> qemu-img info vm-disk1-decompressed.vmdk
image: vm-disk1-decompressed.vmdk
file format: vmdk
virtual size: 22 GiB (23667847168 bytes)
disk size: 709 MiB
cluster_size: 65536
Format specific information:
    cid: 3421777080
    parent cid: 4294967295
    create type: monolithicSparse
    extents:
        [0]:
            virtual size: 23667847168
            filename: vm-disk1-decompressed.vmdk
            cluster size: 65536
            format:
Ok, now it is "monolithicSparse" and not-compressed disk image type.

Because we just created a new disk, old checksum in file "vm.mf" cannot be used so just delete this file before trying to import again

Replace the  original "vm-disk1.vmdk" with "vm-disk1-decompressed.vmdk"(or edit the "vm.ovf" to make it point to "vm-disk1-decompressed.vmdk", no need to correct the disk size information in this case)

Now try to import again "vm.ovf" and we should be able to import it to VirtualBox. After this step, we can modify the config of the imported VM (cpu numer, memory size, etc., just check the "vm.ovf" and try to set the same config)

After this step, we can run the imported virtual machine, but if you see the error No bootable medium found! System halted , you should enable the "Enable EFI" config:


Done.

Saturday, January 14, 2023

'cmake'と'ccache'を一緒に使用する方法

CmakeではCMAKE__COMPILER_LAUNCHERがあり,これを使用するとコンパイラーを呼び出す時に一緒に呼び出される 使用例: 下記のようにtoolchainファイルに書き加えて使用するか,Cmakeを呼び出す時に-DCMAKE__COMPILER_LAUNCHERで定義して実行する
set(CMAKE_C_COMPILER_LAUNCHER ccache CACHE INTERNAL "")
set(CMAKE_CXX_COMPILER_LAUNCHER ccache CACHE INTERNAL "")
この設定は,cmake 3.4から使用できる

Monday, August 15, 2022

.NET Framework and .NET Core

・「.NET」は「.NET Framework」と考えていい - .NET Frameworkはアプリケーションフレームワークで,下記のものから構成されている - CLR (Common Language Runtime,共通言語ラインタイム) - BCL(Base Class Library,基本クラスライブラリ) - 各種ライブラリ、フレームワーク - Ex: ASP.NET, WPF ... - .NET Core: 新しい.NET実装で,オープンソース,クロスプラットフォームコンソールアプリケーション,ASP.NET Core Web Appとクラウン度サービスをビルドできる - .NET Standard: すべての .NET 実装が実装する必要のある基本 API のセット,この API を基本クラス ライブラリ (BCL) と呼びます。.NET Standard をターゲットにすることで、どの .NET 実装やどの OS で実行されても、すべての .NET アプリケーションが共有できるライブラリをビルドできます

Monday, May 30, 2022

xargsコマンドのオプション -n[number]

findコマンドとxargsの組み合わせで,-n[number]オプションの使用のメモ... xargsコマンドに-n1を指定すると1つの引数だけを指定したコマンド(下記のecho)に渡すようになる
$ ls
fileA  fileB  fileC  fileD
$ find . -type f | xargs echo
./fileA ./fileC ./fileD ./fileB
$ find . -type f | xargs -n1  echo
./fileA
./fileC
./fileD
./fileB
$

Friday, May 20, 2022

Bring back taskbar to the default one after accidentally changed it in Lubuntu

Default lxpanel setting: /usr/share/lxpanel/profile/Lubuntu/panels/panel 

So just need to copy it to: ~/.config/lxpanel/Lubuntu/panels/panel