# PYNQ SD Card build environment

**URL:** <https://discuss.pynq.io/t/pynq-sd-card-build-environment/72>\
**Category:** Support\
**Created:** [May 10, 2019, 12:49pm UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72 "2019-05-10T12:49:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gpcus](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gpcus/32/54_2.png) [@gpcus](https://discuss.pynq.io/u/gpcus)\
**Post date:** [May 10, 2019, 12:49pm UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/1 "2019-05-10T12:49:36Z")

</div>

Hello there,  
I am creating a build environment following the documentation instruction [here](https://pynq.readthedocs.io/en/latest/pynq_sd_card.html).  
Everything is fine and apparently without errors to the end of step 4. vagrant reload.  
Now I must install the xilinx tools… I must install them on the guest VM, shall I?  
But how to access the VM?  
As Ubuntu, vagrant or guest? And what password? I didn’t enter any password during the set up…

 ![Capture](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/1X/8e1d60744bfd6472d5e7e35a0754f92aaa88f73c.jpeg)  
Can anyone help me ?  
Best regards  
Guido

---

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [May 10, 2019, 1:32pm UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/2 "2019-05-10T13:32:51Z")

</div>

Hi Guido,  
Yes, you need to install the Xilinx tools to the guest VM.

The username/password should be **vagrant**

Cathal

---

<div class="post-metadata">

**Author:** ![gpcus](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gpcus/32/54_2.png) [@gpcus](https://discuss.pynq.io/u/gpcus)\
**Post date:** [May 10, 2019, 1:33pm UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/3 "2019-05-10T13:33:34Z")

</div>

vagrant  
vagrant  
😀

---

<div class="post-metadata">

**Author:** ![gpcus](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gpcus/32/54_2.png) [@gpcus](https://discuss.pynq.io/u/gpcus)\
**Post date:** [May 10, 2019, 2:04pm UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/4 "2019-05-10T14:04:39Z")

</div>

Thanks. I still don’t have administrator rights on the machine… but sudo seems to work. Next one is: I am installing Vivado 2018.3… I stripped everything out but still requires 22GB (sic!), and the VM is only roughly 8GB. What shall I do? I thought the vagrant thing would dimension the VM with the required amount of disk, wouldn’t it?

 ![Capture](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/1X/d0d8a0fc7180a4d42ccfbce94c40571bcbbec81e.jpeg)  
Best regards

---

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [May 10, 2019, 2:32pm UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/5 "2019-05-10T14:32:44Z")

</div>

The admin permission is normal for Ubuntu. Just use sudo as needed.

If you stop the VM, in VirtualBox you should be able to increase the size of the disk.

It should only allocate space on your host disk as the space is used up on the disk in the VM. E.g. if you allocate 40GB and are only using 20GB, it should only take up ~20GB on your host disk, and will grow as needed when you use more space in the VM. However, you can’t reduce the size of the disk.

Cathal

---

<div class="post-metadata">

**Author:** ![rock](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rock/32/32_2.png) [@rock](https://discuss.pynq.io/u/rock)\
**Post date:** [May 10, 2019, 3:57pm UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/6 "2019-05-10T15:57:33Z")

</div>

The default vagrant setup file allocates 100GB, which should be enough for installing all xilinx tools. So you would probably use the original vagrant file provided on the github.

---

<div class="post-metadata">

**Author:** ![gpcus](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gpcus/32/54_2.png) [@gpcus](https://discuss.pynq.io/u/gpcus)\
**Post date:** [May 13, 2019, 7:03am UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/7 "2019-05-13T07:03:42Z")

</div>

Maybe I wasn’t clear: I used the vagrant setup!

---

<div class="post-metadata">

**Author:** ![gpcus](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gpcus/32/54_2.png) [@gpcus](https://discuss.pynq.io/u/gpcus)\
**Post date:** [May 13, 2019, 7:18am UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/8 "2019-05-13T07:18:45Z")

</div>

By the way, just for reference:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/1X/82098bf1bf47593230cb8bdb2a33b39965eb1b9a.png)

- the main disk (Computer) is 10GB
- the pynq shared subfolder is 54GB
- the other disk (cidata) need admin authentication to be mounted  
So the only place I can install the vivado behemoth is the shared folder… it seems, though, that I am running into path length problems there.

---

<div class="post-metadata">

**Author:** ![gpcus](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gpcus/32/54_2.png) [@gpcus](https://discuss.pynq.io/u/gpcus)\
**Post date:** [May 13, 2019, 7:45am UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/9 "2019-05-13T07:45:12Z")

</div>

![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/1X/89f83b52b96a787ed77fb0acd6e8d3eed1559249.png)

---

<div class="post-metadata">

**Author:** ![gpcus](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gpcus/32/54_2.png) [@gpcus](https://discuss.pynq.io/u/gpcus)\
**Post date:** [May 13, 2019, 8:09am UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/10 "2019-05-13T08:09:06Z")

</div>

Looking at the VM settings, there is a 100GB disk.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/1X/4014be067dd702ba1bff9b689ecbc7b5e6134b9a.png)  
So I am now trying to install vivado into /sdbuild

---

<div class="post-metadata">

**Author:** ![gpcus](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gpcus/32/54_2.png) [@gpcus](https://discuss.pynq.io/u/gpcus)\
**Post date:** [May 13, 2019, 10:30am UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/11 "2019-05-13T10:30:31Z")

</div>

Vivado in /sdbuild… Success!  
Now Petalinux… not enough disk space to save the 6.8GB in the standard home/vagrant/Downloads folder (it does say so only after few GB and hours…)!  
Change Firefox save folder to /sdbuild/Xilinx/Downloads… no permission to write into it(at least it say so immediately)!  
Resolving to download the file in windows and moving it to pynq shared folder…  
Such a pain!

---

<div class="post-metadata">

**Author:** ![gpcus](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gpcus/32/54_2.png) [@gpcus](https://discuss.pynq.io/u/gpcus)\
**Post date:** [May 13, 2019, 12:42pm UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/12 "2019-05-13T12:42:23Z")

</div>

Finally got the Petalinux installer in the VM…  
Log file follows, given it’s not possibleto attach files to board messages:

vagrant@ubuntu-xenial:/sdbuild$ ./petalinux-v2018.3-final-installer.run ./Xilinx/Petalinux  
INFO: Checking installation environment requirements…  
INFO: Checking free disk space  
INFO: Checking installed tools  
INFO: Checking installed development libraries  
ERROR: You are missing these development libraries required by PetaLinux:

- zlib1g:i386

Please install them with your operating system package manager, and try again  
WARNING: Please install required packages.

Please refer to the PetaLinux Tools Installation Guide.

Check the troubleshooting guide at the end of that manual, and if you are  
unable to resolve the issue please contact customer support with file:  
/sdbuild/petalinux\_installation\_log

---

<div class="post-metadata">

**Author:** ![gpcus](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gpcus/32/54_2.png) [@gpcus](https://discuss.pynq.io/u/gpcus)\
**Post date:** [May 13, 2019, 12:46pm UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/13 "2019-05-13T12:46:49Z")

</div>

So zlib1g:i386 is missing, so long for the vagrant environment setup… but let’s try to install it manually!  
Oh no!!!  
vagrant@ubuntu-xenial:/sdbuild$ sudo apt-get install zlib1g:i386  
Reading package lists… Done  
Building dependency tree  
Reading state information… Done  
Package zlib1g:i386 is not available, but is referred to by another package.  
This may mean that the package is missing, has been obsoleted, or  
is only available from another source

E: Package ‘zlib1g:i386’ has no installation candidate

---

<div class="post-metadata">

**Author:** ![gpcus](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gpcus/32/54_2.png) [@gpcus](https://discuss.pynq.io/u/gpcus)\
**Post date:** [May 13, 2019, 1:03pm UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/14 "2019-05-13T13:03:04Z")

</div>

Needs:  
$ sudo dpkg --add-architecture i386  
$ sudo apt update  
before running  
$ sudo apt-get install -y zlib1g:i386

---

<div class="post-metadata">

**Author:** ![gpcus](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gpcus/32/54_2.png) [@gpcus](https://discuss.pynq.io/u/gpcus)\
**Post date:** [May 13, 2019, 2:02pm UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/15 "2019-05-13T14:02:44Z")

</div>

And, after a little chmod’ing around folders, I seem to have succeeded!  
Now “ **Building the Image** ”…

---

<div class="post-metadata">

**Author:** ![gpcus](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gpcus/32/54_2.png) [@gpcus](https://discuss.pynq.io/u/gpcus)\
**Post date:** [May 13, 2019, 2:54pm UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/16 "2019-05-13T14:54:21Z")

</div>

Unfortunately installing vBox Additions 6.06.61 killed the VM… tbh, the Prepare the Building Environment procedure with vagrant seems needing some tweaks

---

<div class="post-metadata">

**Author:** ![rock](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rock/32/32_2.png) [@rock](https://discuss.pynq.io/u/rock)\
**Post date:** [May 13, 2019, 4:19pm UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/17 "2019-05-13T16:19:39Z")

</div>

setup\_host.sh will be updated based on comments from users. In the next release we expect a more stable version.

I still don’t get it how you end up with not-enough space errors. The vagrant setup file should work… I tested it.

---

<div class="post-metadata">

**Author:** ![gpcus](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gpcus/32/54_2.png) [@gpcus](https://discuss.pynq.io/u/gpcus)\
**Post date:** [May 14, 2019, 9:13am UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/18 "2019-05-14T09:13:34Z")

</div>

You probably had the huge install files already in your host. In fact, with hindsight, is much better download with the host and use the shared folder to exchange files between host and guest. I now believe Vagrant setup works, though not 100% smoothly, as shown above; it must be specified clearly it is necessary ALWAYS to start the VM with “vagrant reload”: if the VM is started manually from the VBOX GUI it doesn’t get up. Additionally, the VM needs guest additions for bigger displays and for bidirectional clipboard, I blinded myself to run command in the tiny terminal of he VM screen. Best regards

---

<div class="post-metadata">

**Author:** ![rock](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rock/32/32_2.png) [@rock](https://discuss.pynq.io/u/rock)\
**Post date:** [May 14, 2019, 3:57pm UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/19 "2019-05-14T15:57:46Z")

</div>

The instructions are documented here: [PYNQ SD Card image — Python productivity for Zynq (Pynq)](https://pynq.readthedocs.io/en/latest/pynq_sd_card.html#prepare-the-building-environment)

But you are right about the guest additions. Those are standard VM plugins so we did not mention in our documents. We can add some instructions for that in the documentation (feel free to add by yourself if you feel comfortable).

---

<div class="post-metadata">

**Author:** ![rock](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rock/32/32_2.png) [@rock](https://discuss.pynq.io/u/rock)\
**Post date:** [October 4, 2019, 5:32am UTC](https://discuss.pynq.io/t/pynq-sd-card-build-environment/72/23 "2019-10-04T05:32:23Z")

</div>

OK. I have tried the vagrant flow, so right now I have an idea of what you talked about. Pardon me for this because I have not run it for a long time. Let me summarize, maybe for other users as well:

1. You need vbox guest additions for bigger display + bidirectional clipboard. For bidirectional clipboad you can enable them in virtual box settings.

2. You need `vagrant reload` in your host machine terminal to start up the VM. Otherwise vagrant won’t work properly. Important!

3. If you do item 2, shared folder will be `/pynq` on your pynq\_vm; on your host machine, the shared folder is pointing to the location where you run `vagrant up` initially. Use this shared folder to move files around between your host machine and your pynq\_vm.

4. Please don’t install packages or run make in `/pynq`, even though it may contain all the files from github. `/pynq` is just a small shared folder.

5. The 100GB disk is located at `/sdbuild`. Install Xilinx tools here. Run the sdbuild make process in this folder as well. The best practice is to clone the PYNQ repository here. For example,

```auto
cd /sdbuild
git clone --recursive https://github.com/Xilinx/PYNQ.git pynq-git
cd pynq-git/sdbuild
make

```

Hope this will help other users. I will try to include this in the docs.
