Меню Рубрики

Установка raspbian на vmware

Установка raspbian на vmware

How could I install Raspbian GNU/Linux 8.0 (Jessie) on a virtual machine (VMWare) ? Do you known a procedure for do that ?

Re: STICKY: Debian Jessie with PIXEL desktop i386 for PC and Mac

Re: STICKY: Debian Jessie with PIXEL desktop i386 for PC and Mac

Re: STICKY: Debian Jessie with PIXEL desktop i386 for PC and Mac

Re: STICKY: Debian Jessie with PIXEL desktop i386 for PC and Mac

Re: STICKY: Debian Jessie with PIXEL desktop i386 for PC and Mac

Retired disgracefully.
. to an uncomplicated life !

Rather than negativity think outside the box !

Re: How could I install Raspbian GNU/Linux 8.0 (Jessie) on a virtual machine (VMWare)

Re: How could I install Raspbian GNU/Linux 8.0 (Jessie) on a virtual machine (VMWare)

Retired disgracefully.
. to an uncomplicated life !

Rather than negativity think outside the box !

Re: How could I install Raspbian GNU/Linux 8.0 (Jessie) on a virtual machine (VMWare)

Why do you keep mentioning QEMU?

The OP has already said he has downloaded «2017-06-22-rpd-x86-jessie.iso» which is the x86 build of «Debian with a Raspbian type desktop» that runs directly on a PC.
Running this in VMWare is perfectly feasible — no ARM emulator required because it uses x86 instrutions.

@Lordaker — choose «debian 8» as the type of linux OS.

Re: How could I install Raspbian GNU/Linux 8.0 (Jessie) on a virtual machine (VMWare)

Retired disgracefully.
. to an uncomplicated life !

Rather than negativity think outside the box !

Re: How could I install Raspbian GNU/Linux 8.0 (Jessie) on a virtual machine (VMWare)

Oh ok. I see where you are coming from now.

But I think with 7 posts the OP is a bit of a newbie and doesn’t appreciate the subtleties of the name difference, so it might have been better to help him understand the differences and see if he really meant to run the ARMHF version of Raspbian on a PC, which requires QEMU or the x86 build of unified DE called «Raspberry Pi Desktop» which can be run directly in VMWare. It wasn’t quite obvious to me.

I took the alternative understanding, thinking that he just called it the wrong thing as I hadn’t read his other posts and took this post at face value.
(I edited my previous post for a bit more accuracy)

Re: How could I install Raspbian GNU/Linux 8.0 (Jessie) on a virtual machine (VMWare)

It was obvious the OP was referring to debian x86 even if he incorrectly stated «raspbian»
(he did mention VMware (x86 only) and the download: 2017-06-22-rpd-x86-jessie.iso)

The mods split the post out of the correct thread (probably at FoTL’s insistence) which only serves to confuse matters.
viewtopic.php?f=63&t=168852

Re: How could I install Raspbian GNU/Linux 8.0 (Jessie) on a virtual machine (VMWare)

Retired disgracefully.
. to an uncomplicated life !

Rather than negativity think outside the box !

Re: How could I install Raspbian GNU/Linux 8.0 (Jessie) on a virtual machine (VMWare)

I also have a problem adding a raspbian commandline version to VMware Fusion.
I tried a new system and used the .img as boot / OS, but this would not load.
The only two options I can think of are the bios type: UEFI or standard. Both don’t seem to work.

Extracting the IMG gives me only a boot partition from about 50mb instead of the 4 GB which I guess it should become.
Extracting it to a SD card with Pi Filler works, but what can I do with a SD card?

Re: How could I install Raspbian GNU/Linux 8.0 (Jessie) on a virtual machine (VMWare)

I also have a problem adding a raspbian commandline version to VMware Fusion.
I tried a new system and used the .img as boot / OS, but this would not load.
The only two options I can think of are the bios type: UEFI or standard. Both don’t seem to work.

Extracting the IMG gives me only a boot partition from about 50mb instead of the 4 GB which I guess it should become.
Extracting it to a SD card with Pi Filler works, but what can I do with a SD card?

источник

Raspbian и QEMU


Всем здравствуйте! Подарили мне недавно raspberry pi, и решил я его поиспользовать. Но, как это обычно бывает, дома времени для этого очень мало, а на работе подключить его не к чему. Поэтому решил поставить себе raspbian на виртуальную машину, для того чтобы использовать на работе. Кому интересно как я это делал прошу присоединиться
Для достижения своей цели я использовал множества статей и сообщений на форумах в различных уголках интернета, ссылки на те статьи, которые вспомню приведу в конце своего повествования. Так же, прошу не пинать за ошибки и стиль повествования, а указывать все недочеты в комментариях, т.к. это первая моя публикация на хабре в частности, и где-либо в общем.

Итак начнём! Чтобы заставить работать raspbian на QEMU нам для начала понадобится ядро линукса под arm-платформу. Существуют уже готовые ядра, но для общего развития я решил попробовать собрать сам.
Для этого на понадобится машина с операционной системой из семейства Linux (на самом деле я просто не знаю можно ли это сделать на других операционках). Я использовал одну из разновидностей Debian, а именно Kali Linux, т.к. он был в тот момент под рукой.
1. С начала скачаем пакеты, которые нам понадобятся для сборки ядра, выполнив следующую команду:

Если вы используете 32х разрядную систему, то нужно будет еще установить х86 библиотеки:

2. Так же нужно установить кросс-компилятор, для этого нужно добавить репозиторий:
deb www.emdebian.org/debian unstable main
И выполнить следующие комманды:

И для совместимости создать символьную метку на компилятор:

3. Следующим шагом нужно выкачать исходники ядра и патч для поддержки ядром архитектуры ARM11 и применить этот патч к исходникам. Для этого выполним следующие команды:

4. Дальше нам нужно будет сконфигурировать ядро под нужды Raspbian.
Для этого выполним следующие комманды:

И в появившемся меню выбираем следующие настройки.
ВАЖНО. При выборе опции, если у Вас напротив опции появилась , нажмите еще раз пробел, чтобы появилась .
а) Указываем кросс-компилятор:
General Setup -> Cross-compiler tool prefix
arm-linux-gnueabihf-
ВАЖНО!Не забудьте указать ‘-‘ в конце

б)Настрйки CPU:
System Type->
[*] Support ARMV6 processor
[*] ARM errata: Invalidation of the Instruction Cache Operation fail
[*] ARM errata: Possible cache data corruption with hit-under-miss enabled

в) Включение поддержки для hard-float бинарников:
Floating point emulation ->
[*] VFP-format floating point maths

г) Включение EABI для ARM:
Kernel Features ->
[*] Use the ARM EABI to compile the kernel
[*] Allow old ABI binaries to run with this kernel

Читайте также:  Установка кондиционер в автомашину

д) Включение поддержки дисков QEMU:
Bus Support->
[*] PCI Support
Device Drivers ->
SCSI Device Support
[*] SCSI Device Support
[*] SCSI Disk Support
[*] SCSI CDROM Support
[*] SCSI low-level drivers ->
[*] SYM53C8XX Version 2 SCSI support

е) Включение devtmpfs:
Device Drivers ->
Generic Driver Options ->
[*] Maintain a devtmpfs filesystem to mount at /dev
[*] Automount devtmpfs at /dev, after the kernel mounted the root

ё) Включение важных файловых систем:
File Systems ->
Ext3 journaling file system support
The Extended 4 (ext4) filesystem
DOS/FAT/NT Filesystems ->
VFAT (Windows-95) fs support

ж) Включение tmpfs:
File Systems ->
Pseudo filesystems->
[*] Tmpfs Virtual Memory file system support (former shm fs)

з) Включение интерфейса сообщений:
Device Drivers ->
Input device support ->
[*] Event interface

и)(по желанию) Включение /proc/config.gz
General Setup ->
[*] Kernel .config support
[*] Enable access to .config through /proc/config.gz

к)(по желанию) Использовать более крупных шрифтов и включение логотипа:
Device Drivers ->
Graphics Support ->
[*] Bootup logo
Console display driver support ->
[*] Select compiled-in fonts
[*] VGA 8×16 font

Далее перходим к самой компиляции ядра. Для этого выполним следующие команды:

Ну и я сразу его копирую в корень, т.к. потом буду прописывать параметры от корня.

На этом сборка ядра для QEMU закончена. Если Вам не хочется повторять всё это, то в конце я выложу ссылки на все файлы.

Следующий этап — это установка QEMU.
Для пользователей ОС Windows всё очень просто. Идем на QEMU ON WINDOWS и качаем архив с последней версией QEMU.
ВАЖНО. Версия QEMU должна быть не ниже 1.5.0, т.к. в ней исправлен критичный баг для эмуляции Raspbian
Для пользователей Windows подробно описывать процесс запуска Raspbian не буду, т.к. он очень похож с процессом запуска на ОС семейства Linux. Если будут вопросы, встретимся в коментариях.

Итак, для начала копируем себе исходники QEMU:

Так же установим зависимости:

Переходим к настройке и установке:

Если у вас появиться сообщение Error: DTC not present, то выполните следующую команду:

Теперь у Вас есть QEMU и ядро, осталось скачать образ Raspbian и провести «настроечную» загрузку.

Для первого запуска Raspbian нужно выполнить следующую комманду:

После загрузки вы увидите приглашение bash:

Закоментируйте строку, нажмите [Ctrl]+[x], сохраните и выйдете

Так же выполните:

И введите:
KERNEL==»sda»,SYMLINK+=»mmcblk0″
KERNEL==»sda?»,SYMLINK+=»mmcblk0p%n»,

Сохраните, закройте и выключите виртуалку:

Теперь всё готово для запуска виртуального Raspbian. Выполните команду:

И если всё прошло удачно, то вы увидите стандартное приглашение Raspbian:

Так же может быть полезным изменение размера диска. Для этого на хосте выполните:

Затем загрузите Raspbian и выполните следующее:

Нажмите [p] и запомните значение Start для sda2.
Затем нажмите [d] и удалите 2 раздел.
Затем нажмите [n] — для создания нового раздела.
Нажмите [p], чтобы указать что он будет primary.
Укажите, что он будет вторым, нажав [2].
Укажите First sector, равный Start.
Для Last Sector просто нажмите [Enter], чтобы использовалось всё свободное место.
Нажмите [w], чтобы выйти, сохранив изменения в таблицу разделов.
Перезагрузитесь, выполнив комманду:

После перезагрузки выполните комманду:

На этом всё. Выполнив комманду

Вы увидите новый размер вашего диска.

На этом, наверное всё что я хотел сказать. Пожалуйста, сильно не пинайте за стиль изложения, а лучше указываёте на конкретные ошибки в комментариях.

источник

3 ways to run Raspberry Pi Desktop on a virtual machine

For once, we won’t do anything on the Raspberry Pi directly, but we will instead see how to do without it.

Is it possible to virtualize the Raspberry Pi to use Raspbian on Windows, Linux or Mac?
Yes, it is possible to create a virtual machine that runs Raspbian, to emulate a Raspberry Pi, in 3 different ways:

  1. With a virtual machine in VirtualBox
  2. By emulating it with QEMU
  3. Or with VMWare Workstation

And here we’ll see how to do it with these three tools, from your favorite operating system

This softwares can be very useful if you are a developer, if you don’t have your Raspberry Pi with you, or if you want to test something without breaking your installation on the SD card

Download Raspbian image

I think that’s probably the main problem you’ve encountered, where to find an image compatible with the main hypervisors?

Indeed, the default image offered on the official website, which is an .img format, can not work on VirtualBox for example
Looking for this image, I came across a lot of forums that sa >

And finally, I ended up finding this image, directly on the official website, just above the main download
So you can download the image of Raspian in iso format before continuing this guide
I advise you to use a Torrent client to download it. It’s much faster

Run Raspberry Pi on VirtualBox

Introduction

VirtualBox is an open-source hypervisor, developed by Oracle
It is available for most operating systems: Windows, Linux, Mac OS, Solaris, …
It allows you to create virtual machines on your computer and supports a large number of operating systems to virtualize

Installation

You can find download links for Windows, Mac, and Linux on this page: https://www.virtualbox.org/wiki/Downloads

In any case, the installation is straightforward:

  • Download the installer corresponding to your environment
  • Launch the installer and keep the default options

Create the virtual machine

Launch Oracle VirtualBox now on your computer, and we will create the virtual machine:

  • Click on New in the top bar
  • Choose a Name
  • Type: Linux
  • Version: Anyone
  • Memory size: 1Gb is enough, but you can set more depending on your computer memory available
  • Hard disk: You can keep the default options (10GB)

Our new virtual machine is available, but now you have to tell it to start on the previously downloaded iso file

  • Click on Settings in the top bar
  • Select Storage in the left menu
  • Below the first controller, click on Empty
  • On the right panel, click on the Disc icon to choose the file
  • Select Choose Virtual Optical Disk File
  • Browse to the location of the image and validate

Ok, you should have something like this :

Now we can start the virtual machine and install the Raspberry Pi Desktop :

  • Click on Start in the top bar
  • Choose Install in the first menu
  • Select your Keyboard layout
  • For partition disks, you can keep the default options (use entire disk > all files in one partition > finish > yes)
  • Installation starts
  • After a few minutes, the installation wizard resumes
  • Confirm the bootloader installation to the master boot record
  • Select /dev/sda
  • Continue to reboot your new operating system
Читайте также:  Установка плафона на солярис

Once the reboot is done, you will come to a first start wizard like this one:

Choose the settings that best suits you
Change the default password
Update your system and reboot one last time

Your Raspberry Pi Desktop virtual machine running in VirtualBox is finally operational!

Create a virtual machine in QEMU

Introduction

QEMU is another great open source machine emulator and virtualizer, developed by Fabrice Bellard under GPL License
It can run a lot of guest systems and it also can be used with KVM to increase virtual machines speed
QEMU is available for Linux, Mac OS, and Windows

Installation

The installation is not quite the same depending on your operating system, so I quickly explain how to do

Linux installation:

For Debian/Ubuntu, QEMU is available in the repository so that you can install it with:

For other distributions, it is usually available as easily via the basic commands:

Mac OS installation:

QEMU is available via Homebrew or MacPorts

Windows installation:

You can get the last installer version following this link

Then launch the .exe file and follow instructions

Create the virtual machine

QEMU is a command line tool
So whatever your system you will have to do this 🙂
I give instructions for Linux; it may need to be slightly adapted if you are on another system
In Windows, for example, you need to start the cmd tool, and change to QEMU directory (cd “C:\Program Files\Qemu”)

First, create a folder for your VMs and move the image in

Now let’s launch the image in qemu with the following command:

  • Choose Install in the first menu
  • Select your Keyboard layout
  • For partition disks, you can keep the default options (use entire disk > all files in one partition > finish > yes)
  • Installation starts
  • After a few minutes, the installation wizard resumes
  • Confirm the bootloader installation to the master boot record
  • Select /dev/sda
  • Continue to reboot your new operating system

Once the reboot is done, Raspberry Pi Desktop is starting :

A wizard will start on first boot

Choose the settings that best suits you
Change the default password
Update your system and reboot one last time

Your Raspberry Pi Desktop virtual machine running in QEMU is now operational!

Run Raspbian with WMWare Workstation

Introduction

VMWare Workstation is a proprietary hypervisor distributed by VMWare, a subsidiary of Dell
There is a free version, VMWare Workstation Player, for non-commercial use
Workstation can emulate most operating systems

VMWare also develops many other professional tools, which can allow you to use virtual machines on a large scale, but this is not the subject of the day 🙂

Installation

You can download VMWare Workstation Player on the official website
There is a Linux and Windows version, not sure about Mac OS

On Windows just run the .exe file to start the setup

On Linux you have to start the wizard like this :

You can keep default options, and no key is needed for the moment

On the first start, choose that you want to use Workstation Player for non-commercial use, and we are ready 🙂

(I had problems with Linux at first start, I had to take a newer version than the one given on the site because the modules d >

Create the virtual machine

We will now create our virtual machine

  • Select “Create a New Virtual Machine”
  • Choose “Use ISO image” and Browse to your Raspbian iso file
  • On the next screen, select Linux and Debian 64 bits for example
  • Name your virtual machine and change installation folder if you want
  • For the disk space, you can let 20GB or decrease it to 10GB to save disk space on your computer
  • Finally, click on Finish and Close

Virtual Machine will start directly after the wizard ends

  • Click on Start in the top bar
  • Choose Install in the first menu
  • Select your Keyboard layout
  • For partition disks, you can keep the default options (use entire disk > all files in one partition > finish > yes)
  • Installation starts
  • After a few minutes, the installation wizard resumes
  • Confirm the bootloader installation to the master boot record
  • Select /dev/sda
  • Continue to reboot your new operating system

You can choose to Download and install VMWare Tools if you want (not mandatory)

A wizard will start on first boot

Choose the settings that best suits you
Change the default password
Update your system and reboot one last time

Your Raspberry Pi Desktop virtual machine running in VMWare Workstation is now operational!

What to do next?

Once your virtual machine is installed, and no matter what hypervisor you choose, I invite you to follow the various tutorials of this website to set up the necessary software (ssh, vnc, …), as if you were on a Raspberry Pi

There are probably other things that are more dependent on the fact that your Raspbian is on a virtual machine:

  • network card: by default, I had network and Internet in the 3 installation cases, but maybe depending on your environment, it will not work on first boot. Or maybe you will need the opposite: isolate the virtual machine of the network
  • file sharing: it can be interesting to have a shared folder between your virtual machine and your computer (especially for developers, to work on your computer, and launch the application on the virtual machine)
  • adjust the hardware: you may have to adjust the screen resolution, disk size or RAM to suit your needs

I will not go into detail about all this because it depends on everyone
But be aware that once Raspberry Pi is virtualized and functional, you can follow any tutorial about the chosen hypervisor to help you, it does not depend on Raspbian most of the time

Why do I need a virtual machine?

The following will depend on why you created this virtual machine, but I can give you some ideas

Not (yet) a Raspberry Pi

If you do not have a Raspberry Pi, but you plan to buy one, testing its capabilities on a virtual machine can be a good idea
This allows you to have a good vision of what you will be able to do. Maybe to test, to install, or to program the software which you would like to use, and to do to the purchase only when you’re sure

Moving

You are addicted to Raspberry Pi, but you can not take it everywhere?
A virtual machine on your usual computer will allow you to continue your projects, even without having the Raspberry Pi with you

More powerful

Whether you’re a tester, developer, or just curious, running your Raspberry Pi desktop on a virtual machine will help you increase power and efficiency by taking advantage of your computer’s resources.
This can save you a lot of time on some applications

Snapshots

Obviously who says virtual machine says you can create snapshots
A snapshot and a complete image of the virtual machine at a time T
So it becomes possible to test something, and go back if it does not happen as expected (instead of having to recreate an SD card, reinstall everything needed, etc … if we work directly on the Raspberry Pi)

If you need more help to understand everything here, or if you prefer the video version, here is a demonstration on how to do this wih VirtualBox and VMWare: